StorageTest.php 952 B

12345678910111213141516171819202122232425262728293031323334353637
  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. namespace Symfony\Tests\Components\Templating\Storage;
  11. use Symfony\Components\Templating\Storage\Storage;
  12. use Symfony\Components\Templating\Renderer\PhpRenderer;
  13. class StorageTest extends \PHPUnit_Framework_TestCase
  14. {
  15. public function testMagicToString()
  16. {
  17. $storage = new TestStorage('foo');
  18. $this->assertEquals('foo', (string) $storage, '__toString() returns the template name');
  19. }
  20. public function testGetRenderer()
  21. {
  22. $storage = new TestStorage('foo', $renderer = new PhpRenderer());
  23. $this->assertTrue($storage->getRenderer() === $renderer, '->getRenderer() returns the renderer');
  24. }
  25. }
  26. class TestStorage extends Storage
  27. {
  28. public function getContent()
  29. {
  30. }
  31. }