lithium\tests\cases\security\PasswordTest::testHash PHP Method

testHash() public method

Tests the Password::hash() method with both generated and custom salts.
public testHash ( )
    public function testHash()
    {
        $this->skipIf(!CRYPT_BLOWFISH, 'Blowfish is not supported.');
        $salt = '$2a$07$l1th1um1saw3some12345678$';
        $expected = '$2a$07$l1th1um1saw3some12345uDt5Wuw5uzI5lCIn3HM1QkB7cJLou4Hy';
        $result = Password::hash($this->_password, $salt);
        $this->assertEqual($expected, $result);
        $result = Password::hash($this->_password);
        $this->assertNotEqual($expected, $result);
    }