NullHandlerTest.php 746B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the Monolog package.
  4. *
  5. * (c) Jordi Boggiano <j.boggiano@seld.be>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Monolog\Handler;
  11. use Monolog\TestCase;
  12. use Monolog\Logger;
  13. /**
  14. * @covers Monolog\Handler\NullHandler::handle
  15. */
  16. class NullHandlerTest extends TestCase
  17. {
  18. public function testHandle()
  19. {
  20. $handler = new NullHandler();
  21. $this->assertTrue($handler->handle($this->getRecord()));
  22. }
  23. public function testHandleLowerLevelRecord()
  24. {
  25. $handler = new NullHandler(Logger::WARNING);
  26. $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
  27. }
  28. }