예제 #1
0
 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');
 }
예제 #2
0
 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);
 }