mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-27 13:06:04 +02:00
MINOR: Replaced usage of renamed classes with the new namespaced name. From: Andrew Short <andrewjshort@gmail.com> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90075 467b73ca-7a2a-4603-9d3b-597d59a354a9
36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* @package sapphire
|
|
* @subpackage tests
|
|
*/
|
|
class SS_LogTest extends SapphireTest {
|
|
|
|
protected $testEmailWriter;
|
|
|
|
function setUp() {
|
|
parent::setUp();
|
|
SS_Log::clear_writers(); // this test will break if existing writers are available!
|
|
$this->testEmailWriter = new SS_LogEmailWriter('sean@silverstripe.com');
|
|
$this->testFileWriter = new SS_LogFileWriter('../test.log');
|
|
SS_Log::add_writer($this->testEmailWriter, SS_Log::ERR);
|
|
SS_Log::add_writer($this->testFileWriter, SS_Log::WARN);
|
|
}
|
|
|
|
function testExistingWriter() {
|
|
$writers = SS_Log::get_writers();
|
|
$this->assertType('array', $writers);
|
|
$this->assertEquals(2, count($writers));
|
|
}
|
|
|
|
function testRemoveWriter() {
|
|
SS_Log::remove_writer($this->testEmailWriter);
|
|
$writers = SS_Log::get_writers();
|
|
$this->assertType('array', $writers);
|
|
$this->assertEquals(1, count($writers));
|
|
SS_Log::remove_writer($this->testFileWriter);
|
|
$writers = SS_Log::get_writers();
|
|
$this->assertType('array', $writers);
|
|
$this->assertEquals(0, count($writers));
|
|
}
|
|
|
|
} |