Skip to content

Commit

Permalink
EZP-24750 fix: call to /api/ezp/v2/content/locations/1 caused server …
Browse files Browse the repository at this point in the history
…error

Reason: missing ownerId for fake ContentInfo
  • Loading branch information
Nattfarinn committed Sep 2, 2015
1 parent 3b2d4e7 commit b71bb59
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Repository/Tests/LocationServiceTest.php
Expand Up @@ -333,6 +333,61 @@ public function testLoadLocation()
return $location;
}

/**
* Test for the loadLocation() method.
*
* @see \eZ\Publish\API\Repository\LocationService::loadLocation()
* @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation
*/
public function testLoadLocationRootStructValues()
{
$repository = $this->getRepository();
$locationService = $repository->getLocationService();
$location = $locationService->loadLocation($this->generateId('location', 1));

$legacyDateTime = new \DateTime();
$legacyDateTime->setTimestamp(1030968000);

// $location
$this->assertPropertiesCorrect(
array(
'id' => $this->generateId('location', 1),
'status' => 1,
'priority' => 0,
'hidden' => false,
'invisible' => false,
'remoteId' => '629709ba256fe317c3ddcee35453a96a',
'parentLocationId' => $this->generateId('location', 1),
'pathString' => '/1/',
'depth' => 0,
'sortField' => 1,
'sortOrder' => 1,
),
$location
);

// $location->contentInfo
$this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo', $location->contentInfo);
$this->assertPropertiesCorrect(
array(
'id' => $this->generateId('content', 0),
'name' => 'Top Level Nodes',
'sectionId' => 1,
'mainLocationId' => 1,
'contentTypeId' => 1,
'currentVersionNo' => 1,
'published' => 1,
'ownerId' => 14,
'modificationDate' => $legacyDateTime,
'publishedDate' => $legacyDateTime,
'alwaysAvailable' => 1,
'remoteId' => null,
'mainLanguageCode' => 'eng-GB',
),
$location->contentInfo
);
}

/**
* Test for the loadLocation() method.
*
Expand Down

0 comments on commit b71bb59

Please sign in to comment.