/** * Determine whether a password object needs updating * * Check whether the given password is of the default type. If it is, * pass off further needsUpdate checks to Password::needsUpdate. * * @param Password $password * * @return bool True if needs update, false otherwise */ public function needsUpdate(Password $password) { if ($password->getType() !== $this->default) { return true; } else { return $password->needsUpdate(); } }
/** * @covers Password::__construct */ public function test__construct() { $pass = new \Password("secret string"); $this->assertEquals("input", $pass->getType()); $this->assertEquals("password", $pass->get("type")); }