SyslogHandlerTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
  12. {
  13. /**
  14. * @covers Monolog\Handler\SyslogHandler::__construct
  15. */
  16. public function testConstruct()
  17. {
  18. $handler = new SyslogHandler('test');
  19. $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
  20. $handler = new SyslogHandler('test', LOG_USER);
  21. $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
  22. $handler = new SyslogHandler('test', 'user');
  23. $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
  24. }
  25. /**
  26. * @covers Monolog\Handler\SyslogHandler::__construct
  27. */
  28. public function testConstructInvalidFacility()
  29. {
  30. $this->setExpectedException('UnexpectedValueException');
  31. $handler = new SyslogHandler('test', 'unknown');
  32. }
  33. }