eZ\Publish\Core\Repository\Tests\Service\Integration\TrashBase::testTrashUpdatesMainLocation PHP Method

testTrashUpdatesMainLocation() public method

Test sending a location to trash.
    public function testTrashUpdatesMainLocation()
    {
        $contentService = $this->repository->getContentService();
        $locationService = $this->repository->getLocationService();
        $trashService = $this->repository->getTrashService();
        $contentInfo = $contentService->loadContentInfo(42);
        // Create additional location that will become new main location
        $location = $locationService->createLocation($contentInfo, new LocationCreateStruct(array('parentLocationId' => 2)));
        $trashService->trash($locationService->loadLocation($contentInfo->mainLocationId));
        self::assertEquals($location->id, $contentService->loadContentInfo(42)->mainLocationId);
    }