getMockBuilder('OCP\IRequest')->getMock(); $config = $this->getMockBuilder('OCP\IConfig')->getMock(); $this->controller = new SettingsController( 'externalpassword', $request, $config ); } public function testSave() { $changePasswordUrl = 'https://example.com/change-password'; $descriptionText = 'Use the link below to change your password'; $buttonText = 'Change password'; $result = $this->controller->saveSettings($changePasswordUrl, $descriptionText, $buttonText); $this->assertTrue($result instanceof JSONResponse); } }