示例#1
0
 public function testGetContent()
 {
     $storage = new FileStorage('foo');
     $this->assertTrue($storage instanceof Storage, 'FileStorage is an instance of Storage');
     $storage = new FileStorage(__DIR__ . '/../../../../../fixtures/Symfony/Components/Templating/templates/foo.php');
     $this->assertEquals($storage->getContent(), '<?php echo $foo ?>', '->getContent() returns the content of the template');
 }
示例#2
0
 public function testGetContent()
 {
     $storage = new FileStorage('foo');
     $this->assertInstanceOf('Symfony\\Components\\Templating\\Storage\\Storage', $storage, 'FileStorage is an instance of Storage');
     $storage = new FileStorage(__DIR__ . '/../Fixtures/templates/foo.php');
     $this->assertEquals('<?php echo $foo ?>', $storage->getContent(), '->getContent() returns the content of the template');
 }
示例#3
0
<?php

/*
 * This file is part of the symfony package.
 *
 * (c) Fabien Potencier <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

require_once __DIR__.'/../../../../bootstrap.php';

use Symfony\Components\Templating\Storage\Storage;
use Symfony\Components\Templating\Storage\FileStorage;

$t = new LimeTest(2);

$storage = new FileStorage('foo');
$t->ok($storage instanceof Storage, 'FileStorage is an instance of Storage');

// ->getContent()
$t->diag('->getContent()');
$storage = new FileStorage(__DIR__.'/../../../../../fixtures/Symfony/Components/Templating/templates/foo.php');
$t->is($storage->getContent(), '<?php echo $foo ?>', '->getContent() returns the content of the template');