/** * @test */ public function binds_and_renders() { $this->input->setOption('test-option', 'test-option'); $this->template->getName()->willReturn('test/foobar')->shouldBeCalled(); $this->template->bind(['author' => 'cslucano'])->shouldBeCalled(); $this->template->render()->willReturn('foo')->shouldBeCalled(); $this->helper->registerTemplate($this->template->reveal()); $res = $this->helper->bindAndRender(['author' => 'cslucano'], 'test', 'foobar'); $this->assertEquals('foo', $res); }
/** * @dataProvider getDataForTestRender * * @param string|null $template * @param array $params */ public function testRender($template, $params) { $this->twigEngine->render($template, $params)->shouldBeCalledTimes(1); $this->class->render($template, $params); }