GitProcessorTest.php 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. use Monolog\Level;
  12. class GitProcessorTest extends \Monolog\Test\MonologTestCase
  13. {
  14. /**
  15. * @covers Monolog\Processor\GitProcessor::__invoke
  16. */
  17. public function testProcessor()
  18. {
  19. $processor = new GitProcessor();
  20. $record = $processor($this->getRecord());
  21. $this->assertArrayHasKey('git', $record->extra);
  22. $this->assertTrue(!\is_array($record->extra['git']['branch']));
  23. }
  24. /**
  25. * @covers Monolog\Processor\GitProcessor::__invoke
  26. */
  27. public function testProcessorWithLevel()
  28. {
  29. $processor = new GitProcessor(Level::Error);
  30. $record = $processor($this->getRecord());
  31. $this->assertArrayNotHasKey('git', $record->extra);
  32. }
  33. }