Skip to content

Commit

Permalink
IBX-3957: Applied review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed May 13, 2024
1 parent 51dfca1 commit 45a4e65
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/integration/Core/Repository/URLAliasServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1520,11 +1522,11 @@ public function testRenamingParentContentDoesntBreakChildAlias(): void
$contentService->publishVersion($renamedFolder->getVersionInfo());

// Loading aliases shouldn't throw a `BadStateException`
/** @var array<int, \Ibexa\Contracts\Core\Repository\Values\Content\URLAlias> $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');
Expand Down

0 comments on commit 45a4e65

Please sign in to comment.