HashPassword($correct); $this->assertTrue($hasher->CheckPassword($correct, $hash)); } public function testIncorrectHash() { $hasher = new PasswordHash(8,false); $correct = 'test12345'; $hash = $hasher->HashPassword($correct); $wrong = 'test12346'; $this->assertFalse($hasher->CheckPassword($wrong, $hash)); } public function testWeakHashes() { $hasher = new PasswordHash(8, true); $correct = 'test12345'; $hash = $hasher->HashPassword($correct); $wrong = 'test12346'; $this->assertTrue($hasher->CheckPassword($correct, $hash)); $this->assertFalse($hasher->CheckPassword($wrong, $hash)); } public function testPortableHashes() { $hasher = new PasswordHash(8, true); $correct = 'test12345'; $wrong = 'test12346'; $this->assertTrue($hasher->CheckPassword($correct, self::PORTABLE_HASH)); $this->assertFalse($hasher->CheckPassword($wrong, self::PORTABLE_HASH)); } }