FileStorageTest.php 947 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. namespace Symfony\Tests\Components\Templating\Storage;
  11. require_once __DIR__.'/../../../bootstrap.php';
  12. use Symfony\Components\Templating\Storage\Storage;
  13. use Symfony\Components\Templating\Storage\FileStorage;
  14. class FileStorageTest extends \PHPUnit_Framework_TestCase
  15. {
  16. public function testGetContent()
  17. {
  18. $storage = new FileStorage('foo');
  19. $this->assertTrue($storage instanceof Storage, 'FileStorage is an instance of Storage');
  20. $storage = new FileStorage(__DIR__.'/../../../../../fixtures/Symfony/Components/Templating/templates/foo.php');
  21. $this->assertEquals('<?php echo $foo ?>', $storage->getContent(), '->getContent() returns the content of the template');
  22. }
  23. }