Skip to content

Commit

Permalink
EZP-30139: Fixed testRevealContent randomly failing on PostgreSQL (#2569
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alongosz authored and adamwojs committed Mar 20, 2019
1 parent 662a56e commit 64e9fab
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion eZ/Publish/API/Repository/Tests/ContentServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6241,9 +6241,13 @@ public function testHideContent(array $locationsToHide)
}

/**
* @param \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct[] $locationsToHide
* @param \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct[] $locationsToReveal
*
* @dataProvider provideLocationsToHideAndReveal
*
* @throws \eZ\Publish\API\Repository\Exceptions\ForbiddenException
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
* @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
*/
public function testRevealContent(array $locationsToReveal)
{
Expand All @@ -6268,6 +6272,13 @@ public function testRevealContent(array $locationsToReveal)

$publishedContent = $contentService->publishVersion($content->versionInfo);
$locations = $locationService->loadLocations($publishedContent->contentInfo);
// sort the Locations putting hidden one on top, as the order in which they're returned is not deterministic
usort(
$locations,
function (Location $location) {
return $location->hidden ? -1 : 1;
}
);

// Sanity check
$this->assertCount(3, $locations);
Expand Down

0 comments on commit 64e9fab

Please sign in to comment.