From 45a4e654351b3d05663acf67552bb9ed12f9a602 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Mon, 13 May 2024 11:04:30 +0200 Subject: [PATCH] IBX-3957: Applied review remarks --- .../Core/Repository/URLAliasServiceTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/integration/Core/Repository/URLAliasServiceTest.php b/tests/integration/Core/Repository/URLAliasServiceTest.php index 351dc8075e..b7b7db97ad 100644 --- a/tests/integration/Core/Repository/URLAliasServiceTest.php +++ b/tests/integration/Core/Repository/URLAliasServiceTest.php @@ -1501,8 +1501,10 @@ public function testRenamingParentContentDoesntBreakChildAlias(): void // 2. Create child folder $child = $this->createFolder([$languageCode => 'b'], $folderLocationId); - /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $childLocation */ $childLocation = $child->getVersionInfo()->getContentInfo()->getMainLocation(); + + self::assertInstanceOf(Location::class, $childLocation); + $childLocationId = $childLocation->id; // 3. Create custom URL alias for child folder @@ -1520,11 +1522,11 @@ public function testRenamingParentContentDoesntBreakChildAlias(): void $contentService->publishVersion($renamedFolder->getVersionInfo()); // Loading aliases shouldn't throw a `BadStateException` - /** @var array $childLocationAliases */ $childLocationAliases = $urlAliasService->listLocationAliases($childLocation); + $childLocationAliasesUnpacked = iterator_to_array($childLocationAliases); - self::assertCount(1, $childLocationAliases); - self::assertSame('/c/b', $childLocationAliases[0]->path); + self::assertCount(1, $childLocationAliasesUnpacked); + self::assertSame('/c/b', $childLocationAliasesUnpacked[0]->path); // Renamed content should have '/c2' path alias $lookupRenamed = $urlAliasService->lookup('c2');