create fake implementations for auth and user repo
This commit is contained in:
parent
ee48f578be
commit
2d7ada60fd
2 changed files with 42 additions and 0 deletions
29
tests/Fakes/FakeUserRepository.php
Normal file
29
tests/Fakes/FakeUserRepository.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use Yisroel\DigiWill\Domain\User;
|
||||
use Yisroel\DigiWill\Repositories\UserRepository;
|
||||
|
||||
class FakeUserRepository implements UserRepository
|
||||
{
|
||||
private array $users;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->users = [];
|
||||
}
|
||||
|
||||
public function find(int $id): ?User
|
||||
{
|
||||
}
|
||||
|
||||
public function findByEmail(string $email): ?User
|
||||
{
|
||||
}
|
||||
|
||||
public function save(User $user): User
|
||||
{
|
||||
$this->users[$user->getId()] = $user;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue