TestCase.php 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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;
  11. class TestCase extends \PHPUnit_Framework_TestCase
  12. {
  13. protected function getRecord($level = Logger::WARNING, $message = 'test')
  14. {
  15. return array(
  16. 'message' => $message,
  17. 'level' => $level,
  18. 'level_name' => Logger::getLevelName($level),
  19. 'channel' => 'test',
  20. 'datetime' => new \DateTime(),
  21. 'extra' => array(),
  22. );
  23. }
  24. /**
  25. * @return Monolog\Formatter\FormatterInterface
  26. */
  27. protected function getIdentityFormatter()
  28. {
  29. $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
  30. $formatter->expects($this->any())
  31. ->method('format')
  32. ->will($this->returnArgument(0));
  33. return $formatter;
  34. }
  35. }