SyslogHandlerTest.php 1.1KB

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