/**
  * Get the account in a reliable manner.
  */
 public function account()
 {
     assert($this->_account_id);
     return AccountFactory::findById($this->_account_id);
 }
 function setUp()
 {
     $this->account_id = TestAccountCreateAndDestroy::account_id();
     $this->account = AccountFactory::findById($this->account_id);
     $this->nonce = nonce();
 }
 public function testPerformingAResetInvalidatesUsedRequest()
 {
     $account_id = TestAccountCreateAndDestroy::account_id();
     $account = AccountFactory::findById($account_id);
     PasswordResetRequest::generate($account, $this->nonce = '77warkwark', false);
     PasswordResetRequest::reset($account, 'new_pass34532');
     $req = PasswordResetRequest::match($this->nonce);
     $this->assertEmpty($req);
     // Request shouldn't match because it should already be used.
 }