public function testPhpRendererDoesntSuckWhenTemplateNotThere() { $loader = new FileLoader('./'); $renderer = new PhpTemplatesRenderer($loader); $this->expectOutputString('there is no template for [ i-don-t-exist ]'); echo $renderer->render('i-don-t-exist'); }
public function testRendersFromBasePath() { $loader = new FileLoader(__DIR__ . "/templates", "php"); $renderer = new PhpTemplatesRenderer($loader); $string = $renderer->render('test_template', ['body' => 'whatever']); $this->assertInternalType('string', $string); $this->assertContains('whatever', $string); }