1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-15 13:54:37 +02:00
Files
php-monolog/tests/Monolog/Handler/AbstractHandlerTest.php
Christophe Coevoet 3cb3dbdc8f Made the write method protected
Tests are not a good reason to make it public.
2011-04-06 13:22:06 +02:00

50 lines
1.3 KiB
PHP

<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
class AbstractHandlerTest extends TestCase
{
public function testHandle()
{
$handler = new TestHandler();
$this->assertTrue($handler->handle($this->getRecord()));
}
public function testHandleLowerLevelMessage()
{
$handler = new TestHandler(Logger::WARNING);
$this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
}
public function testHandleBubbling()
{
$handler = new TestHandler(Logger::DEBUG, true);
$this->assertFalse($handler->handle($this->getRecord()));
}
public function testHandleNotBubbling()
{
$handler = new TestHandler(Logger::DEBUG);
$this->assertTrue($handler->handle($this->getRecord()));
}
public function testIsHandling()
{
$handler = new TestHandler(Logger::WARNING);
$this->assertTrue($handler->handle($this->getRecord()));
$this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
}
}