Esempio n. 1
0
 /**
  * @return static BCrypt Instance
  */
 public static function instance()
 {
     if (isset(static::$cache['hash']) && is_object(static::$cache['hash'])) {
         return static::$cache['hash'];
     }
     return static::$cache['hash'] = BCrypt::make();
 }
Esempio n. 2
0
 public function testCreateHashByCryptMockInstance()
 {
     $hash = m::mock('Cygnite\\Hash\\BCrypt');
     $this->assertInstanceOf('Cygnite\\Hash\\BCrypt', $hash);
     $crypt = Hash::instance();
     $this->assertEquals(BCrypt::make(), $crypt);
     $this->assertInstanceOf('Cygnite\\Hash\\BCrypt', BCrypt::make());
 }