public function testLoadContentDrafts() { $contentService = $this->repository->getContentService(); // delete existing drafts before we begin $draftedVersions = $contentService->loadContentDrafts(); foreach ($draftedVersions as $draftedVersion) { $contentService->deleteVersion($draftedVersion); } /* BEGIN: Use Case */ // Remote ids of the "Users" user group of a eZ Publish demo installation. $usersUserGroupRemoteId = 'f5c88a2209584891056f987fd965b0ba'; $membersUserGroupRemoteId = '5f7f0bdb3381d6a461d8c29ff53d908f'; // "Users" user group content object $usersUserGroupContentInfo = $contentService->loadContentInfoByRemoteId($usersUserGroupRemoteId); $membersUserGroupContentInfo = $contentService->loadContentInfoByRemoteId($membersUserGroupRemoteId); // Create some drafts $contentService->createContentDraft($usersUserGroupContentInfo); $contentService->createContentDraft($membersUserGroupContentInfo); // Now $contentDrafts should contain two drafted versions $draftedVersions = $contentService->loadContentDrafts(); /* END: Use Case */ $actual = array($draftedVersions[0]->status, $draftedVersions[1]->status, count($draftedVersions), $draftedVersions[0]->getContentInfo()->remoteId, $draftedVersions[1]->getContentInfo()->remoteId); $this->assertEquals(array(VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_DRAFT, 2, $usersUserGroupRemoteId, $membersUserGroupRemoteId), $actual); }