/**
  * test
  *
  * @return void
  */
 public function testChangePasswordGetNotLoggedIn()
 {
     $this->_mockRequestGet();
     $this->_mockAuth();
     $this->Trait->expects($this->any())->method('set')->will($this->returnCallback(function ($param1, $param2 = null) {
         if ($param1 === 'validatePassword') {
             TestCase::assertEquals($param2, false);
         }
     }));
     $this->Trait->changePassword();
 }
Пример #2
0
 /**
  * test
  *
  * @return void
  */
 public function testChangePasswordGetNotLoggedInInsideResetPasswordFlow()
 {
     $this->_mockRequestGet(true);
     $this->_mockAuth();
     $this->_mockFlash();
     $this->_mockSession([Configure::read('Users.Key.Session.resetPasswordUserId') => '00000000-0000-0000-0000-000000000001']);
     $this->Trait->expects($this->any())->method('set')->will($this->returnCallback(function ($param1, $param2 = null) {
         if ($param1 === 'validatePassword') {
             TestCase::assertEquals($param2, false);
         }
     }));
     $this->Trait->changePassword();
 }