HostnameProcessorTest.php 834 B

12345678910111213141516171819202122232425262728
  1. <?php declare(strict_types=1);
  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\Processor;
  11. class HostnameProcessorTest extends \Monolog\Test\MonologTestCase
  12. {
  13. /**
  14. * @covers Monolog\Processor\HostnameProcessor::__invoke
  15. */
  16. public function testProcessor()
  17. {
  18. $processor = new HostnameProcessor();
  19. $record = $processor($this->getRecord());
  20. $this->assertArrayHasKey('hostname', $record->extra);
  21. $this->assertIsString($record->extra['hostname']);
  22. $this->assertNotEmpty($record->extra['hostname']);
  23. $this->assertEquals(gethostname(), $record->extra['hostname']);
  24. }
  25. }