LoaderTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Component\Templating\Tests\Loader;
  11. use Symfony\Component\Templating\Loader\Loader;
  12. use Symfony\Component\Templating\TemplateReferenceInterface;
  13. class LoaderTest extends \PHPUnit_Framework_TestCase
  14. {
  15. public function testGetSetLogger()
  16. {
  17. $loader = new ProjectTemplateLoader4();
  18. $logger = $this->getMock('Psr\Log\LoggerInterface');
  19. $loader->setLogger($logger);
  20. $this->assertSame($logger, $loader->getLogger(), '->setLogger() sets the logger instance');
  21. }
  22. }
  23. class ProjectTemplateLoader4 extends Loader
  24. {
  25. public function load(TemplateReferenceInterface $template)
  26. {
  27. }
  28. public function getLogger()
  29. {
  30. return $this->logger;
  31. }
  32. public function getDebugger()
  33. {
  34. return $this->debugger;
  35. }
  36. public function isFresh(TemplateReferenceInterface $template, $time)
  37. {
  38. return false;
  39. }
  40. }