public function testChangePassword()
 {
     $emailAddress = '*****@*****.**';
     $password = '******';
     $apiUser = new ApiUser($emailAddress, null);
     $this->apiUserRepository->expects($this->once())->method('findUserByHash')->will($this->returnValue($apiUser));
     $apiUser->generateHash();
     $hash = $apiUser->getHash();
     $this->apiUserRepository->expects($this->once())->method('store')->with($apiUser);
     $command = new ChangePasswordCommand();
     $command->password = $password;
     $command->hash = $hash;
     $this->resetPasswordService->changePassword($command);
 }
 public function testConfirm()
 {
     $apiUser = $this->createApiUser();
     $this->apiUserRepository->expects($this->once())->method('findUserByHash')->with($apiUser->getHash())->will($this->returnValue($apiUser));
     $this->apiUserRepository->expects($this->once())->method('store')->with($apiUser);
     $command = new ConfirmCommand();
     $command->hash = $apiUser->getHash();
     $this->service->confirm($command);
 }