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 {