SyslogHandlerTest.php 959 B

12345678910111213141516171819202122232425262728293031323334353637
  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. public function testConstruct()
  15. {
  16. $handler = new SyslogHandler('test');
  17. $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
  18. $handler = new SyslogHandler('test', LOG_LOCAL1);
  19. $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
  20. $handler = new SyslogHandler('test', 'local1');
  21. $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
  22. }
  23. public function testConstructInvalidFacility()
  24. {
  25. $this->setExpectedException('UnexpectedValueException');
  26. $handler = new SyslogHandler('test', 'unknown');
  27. }
  28. }