From b16abf8d94c042f878fab8e42bfb85889ddf8bd9 Mon Sep 17 00:00:00 2001 From: Dawid Parafinski Date: Thu, 31 Oct 2024 12:42:17 +0100 Subject: [PATCH] Move from helper to Repository namespace + unit tests --- src/lib/Repository/ContentService/RelationListFacade.php | 3 ++- .../lib/Repository/ContentService/RelationListFacadeTest.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/Repository/ContentService/RelationListFacade.php b/src/lib/Repository/ContentService/RelationListFacade.php index 61fead67be..445d3be824 100644 --- a/src/lib/Repository/ContentService/RelationListFacade.php +++ b/src/lib/Repository/ContentService/RelationListFacade.php @@ -36,7 +36,8 @@ public function getRelations(VersionInfo $versionInfo): iterable foreach ($relationListIterator as $relationListItem) { if ($relationListItem->hasRelation()) { /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation $relation */ - yield $relationListItem->getRelation(); + $relation = $relationListItem->getRelation(); + yield $relation; } } } diff --git a/tests/lib/Repository/ContentService/RelationListFacadeTest.php b/tests/lib/Repository/ContentService/RelationListFacadeTest.php index af8c7400e2..edf8ddd5d5 100644 --- a/tests/lib/Repository/ContentService/RelationListFacadeTest.php +++ b/tests/lib/Repository/ContentService/RelationListFacadeTest.php @@ -14,15 +14,16 @@ use Ibexa\Contracts\Core\Repository\Values\Content\RelationList\RelationListItemInterface; use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo; use Ibexa\Core\Repository\ContentService\RelationListFacade; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; final class RelationListFacadeTest extends TestCase { - private ContentService $contentService; + private ContentService&MockObject $contentService; private RelationListFacade $relationListFacade; - private VersionInfo $versionInfo; + private VersionInfo&MockObject $versionInfo; protected function setUp(): void {