2
0

GitProcessorTest.php 1017 B

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