コード例 #1
0
 public function testVerifyPasswordHash()
 {
     $password = '******';
     $prefix = Blowfish::getPrefix();
     $crypt = new PasswordLib();
     $test = $crypt->createPasswordHash($password, $prefix);
     $this->assertTrue($crypt->verifyPasswordHash($password, $test));
 }
コード例 #2
0
 public function testGetPrefix()
 {
     if (version_compare(PHP_VERSION, '5.3.7') >= 0) {
         $this->assertEquals('$2y$', Blowfish::getPrefix());
     } else {
         $this->assertEquals('$2a$', Blowfish::getPrefix());
     }
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 public function providePreSaveAlreadyHashed()
 {
     return [[Blowfish::getPrefix() . '07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'], ['$P$ABCDEFGHIJKLMNOPQRSTUVWXYZ01234']];
 }