public function testIsSetPasswordWithoutTokenFailing() { $this->config->expects($this->once())->method('getUserValue')->with('ValidTokenUser', 'owncloud', 'lostpassword', null)->will($this->returnValue(null)); $response = $this->lostController->setPassword('', 'ValidTokenUser', 'NewPassword', true); $expectedResponse = ['status' => 'error', 'msg' => 'Couldn\'t reset password because the token is invalid']; $this->assertSame($expectedResponse, $response); }