StorageTest.php 1001 B

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