Example #1
0
 public function testRender()
 {
     $mockBody = $this->getMockBuilder('Psr\\Http\\Message\\StreamInterface')->disableOriginalConstructor()->getMock();
     $mockResponse = $this->getMockBuilder('Psr\\Http\\Message\\ResponseInterface')->disableOriginalConstructor()->getMock();
     $mockBody->expects($this->once())->method('write')->with("<p>Hello, my name is Matheus.</p>\n")->willReturn(34);
     $mockResponse->expects($this->once())->method('getBody')->willReturn($mockBody);
     $response = $this->view->render($mockResponse, 'hello.tpl', ['name' => 'Matheus']);
     $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response);
 }