public function testRenderingWithNoExtraction() { $file = new File(array('extract' => false)); $this->expectException('Undefined variable: foo'); $content = $file->render("{$this->_path}/template1.html.php", array('foo' => 'bar')); $this->assertEmpty($content); $content = $file->render("{$this->_path}/template2.html.php", array('foo' => 'bar')); $this->assertEqual('bar', $content); }
public function testRenderingWithNoExtraction() { $backup = error_reporting(); error_reporting(E_ALL); $file = new File(array('extract' => false)); $path = $this->_path; $this->assertException('Undefined variable: foo', function () use($file, $path) { $file->render("{$path}/template1.html.php", array('foo' => 'bar')); }); $content = $file->render("{$this->_path}/template2.html.php", array('foo' => 'bar')); $this->assertEqual('bar', $content); error_reporting($backup); }