public function testVerifyPasswordHash()
 {
     $password = '******';
     $prefix = Blowfish::getPrefix();
     $crypt = new PasswordLib();
     $test = $crypt->createPasswordHash($password, $prefix);
     $this->assertTrue($crypt->verifyPasswordHash($password, $test));
 }
 public function testGetPrefix()
 {
     if (version_compare(PHP_VERSION, '5.3.7') >= 0) {
         $this->assertEquals('$2y$', Blowfish::getPrefix());
     } else {
         $this->assertEquals('$2a$', Blowfish::getPrefix());
     }
 }
 public static function provideTestCreate()
 {
     return array(array(Blowfish::getPrefix(), 60), array('$apr1$', 37), array('$S$', 98), array('$P$', 34), array('$H$', 34), array('$pbkdf$', 74));
 }
Beispiel #4
0
 public function providePreSaveAlreadyHashed()
 {
     return [[Blowfish::getPrefix() . '07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'], ['$P$ABCDEFGHIJKLMNOPQRSTUVWXYZ01234']];
 }