public function testRenderConstructorInjection() { $processor = new Processor(array( 'cache' => dirname(__FILE__) . '/templates/', )); $tpl = file_get_contents($this->path . 'tpl1.twig'); $rendered = $processor->render($tpl, array( 'a_variable' => 'Aha!', 'navigation' => array( array( 'href' => 'link1', 'caption' => 'caption1' ), array( 'href' => 'link1', 'caption' => 'caption1' ) ) )); $static = file_get_contents(dirname(__FILE__) . '/templates/tpl1.html'); $this->assertSame(trim($static), trim($rendered)); }