コード例 #1
0
ファイル: hTest.php プロジェクト: ChristopheBrun/hLib
 /**
  * @test
  */
 public function generatePassword()
 {
     $possible = 'abcdefghij';
     // Un mot de passe court testé sur une série limitée de caractères
     $pwd = h::generatePassword(4, $possible);
     $this->assertRegExp("/^[abcdefghij]*\$/", $pwd);
     $this->assertNotRegExp("/^[ABCDEFGHIJ]*\$/", $pwd);
     // Un mot de passe long testé sur une série limitée de caractères
     $pwd = h::generatePassword(44, $possible);
     $this->assertRegExp("/^[abcdefghij]*\$/", $pwd);
     $this->assertNotRegExp("/^[ABCDEFGHIJ]*\$/", $pwd);
     // On suppose que ça marche avec les autres séries aussi, du coup
 }