public function testConstruct() { $request = new Request(['url' => 'places/norway', 'filter' => 'all'], ['HTTP_ACCEPT' => 'text/html,*/*;q=0.8', 'REQUEST_URI' => '/places/norway?filter=all', 'REQUEST_METHOD' => 'GET'], ['url' => 'places/norway', 'filter' => 'all']); $page = new Page($request); $this->assertTrue($page instanceof Response); $this->assertTrue($page instanceof Page); $this->assertSame($request, $page->request()); $ref_contentType = new \ReflectionMethod($page, 'contentType'); $ref_contentType->setAccessible(true); $ref_viewToRender = new \ReflectionMethod($page, 'viewToRender'); $ref_viewToRender->setAccessible(true); $this->assertEquals('text/html', $ref_contentType->invoke($page)); $this->assertEquals('places' . DIRECTORY_SEPARATOR . 'norway.html', $ref_viewToRender->invoke($page)); }