eZ\Publish\Core\Repository\Tests\Service\Integration\LocationBase::testLoadLocationsWithRootLocation PHP Method

testLoadLocationsWithRootLocation() public method

Test loading locations for content with root location specified.
    public function testLoadLocationsWithRootLocation()
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo(12);
        $locationService = $this->repository->getLocationService();
        $parentLocation = $locationService->loadLocation(5);
        $locations = $locationService->loadLocations($contentInfo, $parentLocation);
        self::assertInternalType('array', $locations);
        self::assertNotEmpty($locations);
        foreach ($locations as $location) {
            self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\Location', $location);
        }
        foreach ($locations as $location) {
            if (stripos($location->pathString, $parentLocation->pathString) === false) {
                self::fail('fetched locations outside root node');
            }
        }
    }