silverstripe-framework/tests/dev/SSErrorLogTest.php
Sean Harvey a682ab9c0e API CHANGE Moved Debug::backtrace() to SSBacktrace::backtrace()
API CHANGE Moved Debug::get_rendered_backtrace() to SSBacktrace::get_rendered_backtrace()
ENHANCEMENT Added SSLog, SSLogEmailWriter and SSLogErrorEmailFormatter for silverstripe message reporting
API CHANGE Debug::send_errors_to() and Debug::send_warnings_to() are deprecated in favour of SSLog. See class documentation for SSLog on configuration of error email notifications
MINOR Added SSLogTest for basic testing of the SSLog and SSLogEmailWriter classes



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84774 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-19 03:55:23 +00:00

29 lines
657 B
PHP

<?php
/**
* @package sapphire
* @subpackage tests
*/
class SSLogTest extends SapphireTest {
protected $testEmailWriter;
function setUp() {
parent::setUp();
$this->testEmailWriter = new SSLogEmailWriter('sean@silverstripe.com');
SSLog::add_writer($this->testEmailWriter, SSLog::ERR);
}
function testExistingWriter() {
$writers = SSLog::get_writers();
$this->assertType('array', $writers);
$this->assertEquals(1, count($writers));
}
function testRemoveWriter() {
SSLog::remove_writer($this->testEmailWriter);
$writers = SSLog::get_writers();
$this->assertType('array', $writers);
$this->assertEquals(0, count($writers));
}
}