Exemplo n.º 1
0
 /**
  * @expectedException RuntimeException
  */
 public function testTemplateNotFound()
 {
     $renderer = new \Slim\Views\PhpRenderer("tests/");
     $headers = new Headers();
     $body = new Body(fopen('php://temp', 'r+'));
     $response = new Response(200, $headers, $body);
     $renderer->render($response, "adfadftestTemplate.php", []);
 }
Exemplo n.º 2
0
 public function testRenderer()
 {
     $renderer = new \Slim\Views\PhpRenderer("tests/");
     $headers = new Headers();
     $body = new Body(fopen('php://temp', 'r+'));
     $response = new Response(200, $headers, $body);
     $newResponse = $renderer->render($response, "testTemplate.php", array("hello" => "Hi"));
     $newResponse->getBody()->rewind();
     $this->assertEquals("Hi", $newResponse->getBody()->getContents());
 }