assertTrue($hasher->needsRehash(md5('foo'))); $this->assertTrue($hasher->needsRehash('bar')); $this->assertFalse($hasher->needsRehash('$2y$10$juOA0XVFpvZa0KTxRxEYVuX5kIS7U1fKDRcxyYhhUQECN1oHYnBMy')); } /** * Tests hash() and check() * * @return void */ public function testHashAndCheck() { $hasher = new WeakPasswordHasher(); $hasher->setConfig('hashType', 'md5'); $password = $hasher->hash('foo'); $this->assertTrue($hasher->check('foo', $password)); $this->assertFalse($hasher->check('bar', $password)); $hasher->setConfig('hashType', 'sha1'); $this->assertFalse($hasher->check('foo', $password)); } }