test find elements by set
This commit is contained in:
parent
24fce56c5e
commit
aaa494afe4
2 changed files with 4 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ namespace Tests\Fakes;
|
|||
use App\Element\CreateElementDto;
|
||||
use App\Element\Element;
|
||||
use App\Element\ElementRepository;
|
||||
use App\Set\Set as DomainSet;
|
||||
|
||||
class FakeElementRepository implements ElementRepository
|
||||
{
|
||||
|
|
@ -39,11 +40,11 @@ class FakeElementRepository implements ElementRepository
|
|||
/**
|
||||
* @return Element[]
|
||||
*/
|
||||
public function findBySetId(int $id): array
|
||||
public function findBySet(DomainSet $set): array
|
||||
{
|
||||
$elements = [];
|
||||
foreach ($this->elementsById as $element) {
|
||||
if ($element->getSet()->getId() === $id) {
|
||||
if ($element->getSet()->getId() === $set->getId()) {
|
||||
$elements[] = $this->cloneElement($element);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue