/** * @covers cymapgt\core\application\authentication\UserCredential\UserCredentialManager::validateConsecutiveCharacterRepeat() */ public function testValidateConsecutiveCharacterClassRepeatException() { //here we repeat 2 characters $userProfileAlmostWeak = array("username" => "c.ogana", "password" => "%stron9Pa55sButRepetition!sBaD2015", "fullname" => "Cyril Ogana", "passhash" => "tiger", "passhist" => array(), "policyinfo" => array(), "account_state" => \USERCREDENTIAL_ACCOUNTSTATE_LOGGEDIN); $this->object = new UserCredentialManager($userProfileAlmostWeak); $this->assertTrue($this->object->validateConsecutiveCharacterRepeat()); //here we repeat 3 characters, and expect an exception as per base entropy $this->setExpectedException('cymapgt\\Exception\\UserCredentialException', 'The password violates policy about consecutive repetition of characters of the same class.'); $userProfileWeak = array("username" => "c.ogana", "password" => "%stron9Pa55sButClassrepetition!sBaD2015", "fullname" => "Cyril Ogana", "passhash" => "tiger", "passhist" => array(), "policyinfo" => array(), "account_state" => \USERCREDENTIAL_ACCOUNTSTATE_LOGGEDIN); $this->object = new UserCredentialManager($userProfileWeak); $this->object->validateConsecutiveCharacterRepeat(); }