public function testEvaluate() { $renderer = new PhpRenderer(); $template = new StringStorage('<?php echo $foo ?>'); $this->assertEquals('bar', $renderer->evaluate($template, array('foo' => 'bar')), '->evaluate() renders templates that are instances of StringStorage'); $template = new FileStorage(__DIR__ . '/../Fixtures/templates/foo.php'); $this->assertEquals('bar', $renderer->evaluate($template, array('foo' => 'bar')), '->evaluate() renders templates that are instances of FileStorage'); }
/** * Evaluates a template. * * @param Storage $template The template to render * @param array $parameters An array of parameters to pass to the template * * @return string|false The evaluated template, or false if the renderer is unable to render the template */ public function evaluate(Storage $template, array $parameters = array()) { $storage = new FileStorage($this->jade->cache($template)); return parent::evaluate($storage, $parameters); }