/** * Deletes a trash item. * * The corresponding content object will be removed * * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to delete this trash item * * @param \eZ\Publish\API\Repository\Values\Content\TrashItem $trashItem */ public function deleteTrashItem(TrashItem $trashItem) { if (false === $this->repository->canUser('content', 'remove', $trashItem)) { throw new UnauthorizedExceptionStub('What error code should be used?'); } unset($this->trashItems[$trashItem->id], $this->locations[$trashItem->id]); }
/** * removes an url wildcard * * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to remove url wildcards * * @param \eZ\Publish\API\Repository\Values\Content\UrlWildcard $urlWildcard the url wildcard to remove */ public function remove(URLWildcard $urlWildcard) { if (false === $this->repository->canUser('content', 'edit', $urlWildcard)) { throw new UnauthorizedExceptionStub('What error code should be used?'); } unset($this->wildcards[$urlWildcard->id]); }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { list($this->userGroups) = $this->repository->loadFixture('UserGroup'); list($this->users) = $this->repository->loadFixture('User'); // Set the default relations. $this->user2groups[10] = array(42 => true); $this->user2groups[14] = array(12 => true); }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { $this->groups = array(); list($this->groups, $this->nextGroupId) = $this->repository->loadFixture('ObjectStateGroup'); ++$this->nextGroupId; list($this->states, $this->groupStateMap, $this->objectStateMap, $this->nextStateId) = $this->repository->loadFixture('ObjectState', array('groups' => $this->groups)); ++$this->nextStateId; }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { $this->locations = array(); $this->nextLocationId = 0; list($locations, $this->nextLocationId) = $this->repository->loadFixture('Location'); foreach ($locations as $location) { $this->locations[$location->id] = $location; $this->nextLocationId = max($this->nextLocationId, $location->id); } }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { $this->aliases = array(); $this->nextAliasId = 0; list($aliases, $this->nextAliasId) = $this->repository->loadFixture('URLAlias'); foreach ($aliases as $alias) { $this->aliases[$alias->id] = $alias; $this->nextAliasId = max($this->nextAliasId, $alias->id); } }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { $this->groups = array(); $this->groupsById = array(); list($contentTypeGroups, $this->nextGroupId) = $this->repository->loadFixture('ContentTypeGroup'); ++$this->nextGroupId; foreach ($contentTypeGroups as $group) { $this->setGroup($group); } list($this->types, $this->nextTypeId, $this->nextFieldDefinitionId) = $this->repository->loadFixture('ContentType', array('groups' => $contentTypeGroups)); ++$this->nextTypeId; ++$this->nextFieldDefinitionId; }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { list($this->languages, $this->codes, $this->nextId) = $this->repository->loadFixture('Language'); }
/** * Returns a configured repository for testing. * * @param boolean $initializeFromScratch if the back end should be initialized * from scratch or re-used * @return \eZ\Publish\API\Repository\Repository */ public function getRepository($initializeFromScratch = true) { $repository = new RepositoryStub(__DIR__ . '/../_fixtures', isset($_ENV['backendVersion']) ? (int) $_ENV['backendVersion'] : 5); $repository->setCurrentUser(new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserStub(array('content' => new \eZ\Publish\API\Repository\Tests\Stubs\Values\Content\ContentStub(array('id' => 14))))); return $repository; }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { list($this->roles, $this->nameToRoleId, $this->nextRoleId, $this->content2roles, $this->policies, $this->policyNextId, $this->role2policy, $this->roleLimitations) = $this->repository->loadFixture('Role'); }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { list($this->sections, $this->identifiers, $this->assignedContents, $this->nextId) = $this->repository->loadFixture('Section'); }
/** * Helper method that initializes some default data from an existing legacy * test fixture. * * @return void */ private function initFromFixture() { list($this->contentInfo, $this->contentNextId, $this->versionInfo, $this->versionNextId, $this->content) = $this->repository->loadFixture('Content'); }