Rabbi_Gerzi/backend/tests/Fakes/FakePasswordHasher.php
Yisroel Baum 57c75f64c4
test: add failing authenticate user test
Red phase: write AuthenticateUserTest with cases for valid credentials, empty email/password (null and empty string), unknown email, wrong password, and fresh instance guarantee. Fakes included.
2026-05-17 09:45:22 +03:00

18 lines
342 B
PHP

<?php
namespace Tests\Fakes;
use App\Auth\PasswordHasher;
class FakePasswordHasher implements PasswordHasher
{
public function hash(string $password): string
{
return 'hashed:'.$password;
}
public function verify(string $password, string $hash): bool
{
return $this->hash($password) === $hash;
}
}