Test HTML; mkdir('/tmp/views'); mkdir('/tmp/cache', 777); file_put_contents('/tmp/views/test.blade.php', $contents); $view = new View('/tmp/views', '/tmp/cache'); $body = $this->getMockBuilder(StreamInterface::class)->getMock(); $body->method('getContents')->willReturn($contents); $response = $this->getMockBuilder(ResponseInterface::class)->getMock(); $response->method('getBody')->willReturn($body); $output = $view->render($response, 'test'); $this->assertEquals($contents, $output->getBody()->getContents()); } }