test seeded sets
This commit is contained in:
parent
3bfcdfd0cc
commit
f62b05bc37
3 changed files with 20 additions and 80 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use App\Set\CreateSetDto;
|
||||
use App\Set\Set as DomainSet;
|
||||
use App\Set\SetRepository;
|
||||
|
||||
|
|
@ -13,16 +12,9 @@ class FakeSetRepository implements SetRepository
|
|||
*/
|
||||
private array $setsById = [];
|
||||
|
||||
public function create(CreateSetDto $dto): DomainSet
|
||||
public function store(DomainSet $set): void
|
||||
{
|
||||
$id = count($this->setsById) + 1;
|
||||
$set = new DomainSet(
|
||||
id: $id,
|
||||
name: $dto->name,
|
||||
);
|
||||
$this->setsById[$id] = $set;
|
||||
|
||||
return $set;
|
||||
$this->setsById[$set->getId()] = $set;
|
||||
}
|
||||
|
||||
public function find(int $id): ?DomainSet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue