test seeded sets

This commit is contained in:
Yisroel Baum 2026-05-25 08:24:31 +03:00
parent 3bfcdfd0cc
commit f62b05bc37
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 20 additions and 80 deletions

View file

@ -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