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

testSwapLocation() public method

Test swapping location.
public testSwapLocation ( )
    public function testSwapLocation()
    {
        $locationService = $this->repository->getLocationService();
        $location1 = $locationService->loadLocation(2);
        $location2 = $locationService->loadLocation(44);
        $contentId1 = $location1->getContentInfo()->id;
        $contentId2 = $location2->getContentInfo()->id;
        $locationService->swapLocation($location1, $location2);
        $location1 = $locationService->loadLocation(2);
        $location2 = $locationService->loadLocation(44);
        self::assertEquals($contentId1, $location2->getContentInfo()->id);
        self::assertEquals($contentId2, $location1->getContentInfo()->id);
    }