/** * @return void */ public function testPasswordResetWhenTokenIsValidStateShouldBeChangedToUsed() { $userEntity = $this->createTestUser(); $userEntity->save(); $this->authFacade->requestPasswordReset(self::TEST_MAIL); $userEntity->reload(); $passwordEntity = SpyResetPasswordQuery::create()->findOneByFkUser($userEntity->getIdUser()); $resetStatus = $this->authFacade->resetPassword($passwordEntity->getCode(), 'new'); $passwordEntity->reload(); $this->assertTrue($resetStatus); $this->assertEquals($passwordEntity->getStatus(), SpyResetPasswordTableMap::COL_STATUS_USED); }