/** * Tests that the password only needs to be re-built according to the first hasher * * @return void */ public function testNeedsRehash() { $hasher = new FallbackPasswordHasher(['hashers' => ['Default', 'Weak']]); $weak = new WeakPasswordHasher(); $otherHash = $weak->hash('foo'); $this->assertTrue($hasher->needsRehash($otherHash)); $simple = new DefaultPasswordHasher(); $hash = $simple->hash('foo'); $this->assertFalse($hasher->needsRehash($hash)); }