Skip to content

Commit

Permalink
Fixed comparator function in LocationServiceTest::testLoadLocationsCo…
Browse files Browse the repository at this point in the history
…ntent
  • Loading branch information
adamwojs committed Sep 16, 2020
1 parent 0f3dd70 commit 0b6a433
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions eZ/Publish/API/Repository/Tests/LocationServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,28 +531,22 @@ public function testLoadLocations()
*/
public function testLoadLocationsContent(array $locations)
{
$repository = $this->getRepository();
$locationService = $repository->getLocationService();

$this->assertEquals(1, count($locations));
foreach ($locations as $loadedLocation) {
$this->assertInstanceOf(
'\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location',
$loadedLocation
);
$this->assertInstanceOf(Location::class, $loadedLocation);
}

usort(
$locations,
function ($a, $b) {
strcmp($a->id, $b->id);
static function ($a, $b) {
return strcmp($a->id, $b->id);
}
);

$this->assertEquals(
[$this->generateId('location', 5)],
array_map(
function (Location $location) {
static function (Location $location) {
return $location->id;
},
$locations
Expand Down

0 comments on commit 0b6a433

Please sign in to comment.