/** * @covers cymapgt\core\application\authentication\UserCredential\UserCredentialManager::canChangePassword */ public function testValidatePolicyCanChangePassword() { $userProfile = array("username" => "c.ogana", "password" => "mno", "fullname" => "Cyril Ogana", "passhash" => "tiger", "passhist" => array(\password_hash('abc', \PASSWORD_DEFAULT), \password_hash('def', \PASSWORD_DEFAULT), \password_hash('ghi', \PASSWORD_DEFAULT), \password_hash('jkl', \PASSWORD_DEFAULT), \password_hash('mno', \PASSWORD_DEFAULT), \password_hash('pqr', \PASSWORD_DEFAULT), \password_hash('stu', \PASSWORD_DEFAULT), \password_hash('vwx', \PASSWORD_DEFAULT), \password_hash('xyz', \PASSWORD_DEFAULT)), "policyinfo" => array('failed_attempt_count' => 0, 'password_last_changed_datetime' => new \DateTime(), 'last_login_attempt_datetime' => new \DateTime('2014-03-01 23:45:10')), "account_state" => \USERCREDENTIAL_ACCOUNTSTATE_LOGGEDIN); $this->object = new UserCredentialManager($userProfile); $canChangePassword = $this->object->canChangePassword(); $this->assertInternalType('bool', $canChangePassword); $this->assertEquals(false, $canChangePassword); }
/** * @covers cymapgt\core\application\authentication\UserCredeintial::generateToken */ public function testGenerateToken() { $this->assertEquals(6, strlen(UserCredentialManager::generateToken('rhossis', 'iAmAsTrInGeNcRyPtIoNkEyYo!:)'))); }