mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
29 lines
657 B
PHP
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));
|
||
|
}
|
||
|
|
||
|
}
|