LoaderTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\TemplateNameParser;
  13. use Symfony\Component\Templating\TemplateReferenceInterface;
  14. class LoaderTest extends \PHPUnit_Framework_TestCase
  15. {
  16. public function testGetSetDebugger()
  17. {
  18. $loader = new ProjectTemplateLoader4(new TemplateNameParser());
  19. $loader->setDebugger($debugger = new \Symfony\Component\Templating\Tests\Fixtures\ProjectTemplateDebugger());
  20. $this->assertTrue($loader->getDebugger() === $debugger, '->setDebugger() sets the debugger instance');
  21. }
  22. }
  23. class ProjectTemplateLoader4 extends Loader
  24. {
  25. public function load(TemplateReferenceInterface $template)
  26. {
  27. }
  28. public function getDebugger()
  29. {
  30. return $this->debugger;
  31. }
  32. public function isFresh(TemplateReferenceInterface $template, $time)
  33. {
  34. return false;
  35. }
  36. }