StorageTest.php 816 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.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. require_once __DIR__.'/../../../../bootstrap.php';
  11. use Symfony\Components\Templating\Storage\Storage;
  12. use Symfony\Components\Templating\Renderer\PhpRenderer;
  13. $t = new LimeTest(2);
  14. // __construct() __toString()
  15. $t->diag('__construct() __toString()');
  16. $storage = new Storage('foo');
  17. $t->is((string) $storage, 'foo', '__toString() returns the template name');
  18. // ->getRenderer()
  19. $t->diag('->getRenderer()');
  20. $storage = new Storage('foo', $renderer = new PhpRenderer());
  21. $t->ok($storage->getRenderer() === $renderer, '->getRenderer() returns the renderer');