ProcessIdProcessorTest.php 845 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 ProcessIdProcessorTest extends \Monolog\Test\MonologTestCase
  12. {
  13. /**
  14. * @covers Monolog\Processor\ProcessIdProcessor::__invoke
  15. */
  16. public function testProcessor()
  17. {
  18. $processor = new ProcessIdProcessor();
  19. $record = $processor($this->getRecord());
  20. $this->assertArrayHasKey('process_id', $record->extra);
  21. $this->assertIsInt($record->extra['process_id']);
  22. $this->assertGreaterThan(0, $record->extra['process_id']);
  23. $this->assertEquals(getmypid(), $record->extra['process_id']);
  24. }
  25. }