StorageTest.php 902 B

1234567891011121314151617181920212223242526272829303132333435
  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. class TestStorage extends Storage
  15. {
  16. public function getContent()
  17. {
  18. }
  19. }
  20. // __construct() __toString()
  21. $t->diag('__construct() __toString()');
  22. $storage = new TestStorage('foo');
  23. $t->is((string) $storage, 'foo', '__toString() returns the template name');
  24. // ->getRenderer()
  25. $t->diag('->getRenderer()');
  26. $storage = new TestStorage('foo', $renderer = new PhpRenderer());
  27. $t->ok($storage->getRenderer() === $renderer, '->getRenderer() returns the renderer');