getMockBuilder('OCP\IRequest')->getMock(); $this->controller = new PageController( 'raw', $request, $this->userId ); } public function testIndex() { $result = $this->controller->index(); $this->assertEquals('index', $result->getTemplateName()); $this->assertTrue($result instanceof TemplateResponse); } }