diff --git a/src/contracts/Persistence/Content/Type/Handler.php b/src/contracts/Persistence/Content/Type/Handler.php index 4de56743ee..c406868cc5 100644 --- a/src/contracts/Persistence/Content/Type/Handler.php +++ b/src/contracts/Persistence/Content/Type/Handler.php @@ -70,7 +70,7 @@ public function loadGroupByIdentifier($identifier); /** * @return \Ibexa\Contracts\Core\Persistence\Content\Type\Group[] */ - public function loadAllGroups(); + public function loadAllGroups(bool $includeSystem = false); /** * @param mixed $groupId diff --git a/src/contracts/Repository/ContentTypeService.php b/src/contracts/Repository/ContentTypeService.php index ef3be97702..68ae72db2d 100644 --- a/src/contracts/Repository/ContentTypeService.php +++ b/src/contracts/Repository/ContentTypeService.php @@ -64,10 +64,11 @@ public function loadContentTypeGroupByIdentifier(string $contentTypeGroupIdentif * Get all content type groups. * * @param string[] $prioritizedLanguages Used as prioritized language code on translated properties of returned object. + * @param bool $includeSystem When true also returns system ContentTypeGroups. Default false. * * @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup[] */ - public function loadContentTypeGroups(array $prioritizedLanguages = []): iterable; + public function loadContentTypeGroups(array $prioritizedLanguages = [], bool $includeSystem = false): iterable; /** * Update a content type group object. diff --git a/src/contracts/Repository/Decorator/ContentTypeServiceDecorator.php b/src/contracts/Repository/Decorator/ContentTypeServiceDecorator.php index 3726345dba..dd79d8081f 100644 --- a/src/contracts/Repository/Decorator/ContentTypeServiceDecorator.php +++ b/src/contracts/Repository/Decorator/ContentTypeServiceDecorator.php @@ -52,9 +52,9 @@ public function loadContentTypeGroupByIdentifier( return $this->innerService->loadContentTypeGroupByIdentifier($contentTypeGroupIdentifier, $prioritizedLanguages); } - public function loadContentTypeGroups(array $prioritizedLanguages = []): iterable + public function loadContentTypeGroups(array $prioritizedLanguages = [], bool $includeSystem = false): iterable { - return $this->innerService->loadContentTypeGroups($prioritizedLanguages); + return $this->innerService->loadContentTypeGroups($prioritizedLanguages, $includeSystem); } public function updateContentTypeGroup( diff --git a/src/lib/Persistence/Cache/ContentTypeHandler.php b/src/lib/Persistence/Cache/ContentTypeHandler.php index eece3e1cf7..b991b9667f 100644 --- a/src/lib/Persistence/Cache/ContentTypeHandler.php +++ b/src/lib/Persistence/Cache/ContentTypeHandler.php @@ -100,6 +100,7 @@ public function createGroup(GroupCreateStruct $struct) $this->logger->logCall(__METHOD__, ['struct' => $struct]); $this->cache->deleteItems([ $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true), + $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [true], true), ]); return $this->persistenceHandler->contentTypeHandler()->createGroup($struct); @@ -115,6 +116,7 @@ public function updateGroup(GroupUpdateStruct $struct) $this->cache->deleteItems([ $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true), + $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [true], true), $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_IDENTIFIER, [$struct->id], true), $this->cacheIdentifierGenerator->generateKey( self::CONTENT_TYPE_GROUP_WITH_ID_SUFFIX_IDENTIFIER, @@ -137,6 +139,10 @@ public function deleteGroup($groupId) $this->cache->invalidateTags([ $this->cacheIdentifierGenerator->generateTag(self::TYPE_GROUP_IDENTIFIER, [$groupId]), ]); + $this->cache->deleteItems([ + $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true), + $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [true], true), + ]); return $return; } @@ -193,12 +199,12 @@ function () use ($identifier) { /** * {@inheritdoc} */ - public function loadAllGroups() + public function loadAllGroups(bool $includeSystem = false) { return $this->getListCacheValue( - $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [], true), - function () { - return $this->persistenceHandler->contentTypeHandler()->loadAllGroups(); + $this->cacheIdentifierGenerator->generateKey(self::CONTENT_TYPE_GROUP_LIST_IDENTIFIER, [$includeSystem], true), + function () use ($includeSystem) { + return $this->persistenceHandler->contentTypeHandler()->loadAllGroups($includeSystem); }, $this->getGroupTags, $this->getGroupKeys diff --git a/src/lib/Persistence/Legacy/Content/Type/Gateway.php b/src/lib/Persistence/Legacy/Content/Type/Gateway.php index 3b06531e8a..1de2634393 100644 --- a/src/lib/Persistence/Legacy/Content/Type/Gateway.php +++ b/src/lib/Persistence/Legacy/Content/Type/Gateway.php @@ -52,7 +52,7 @@ abstract public function loadGroupData(array $groupIds): array; abstract public function loadGroupDataByIdentifier(string $identifier): array; - abstract public function loadAllGroupsData(): array; + abstract public function loadAllGroupsData(bool $includeSystem = false): array; /** * Load data for all content types of the given status, belonging to the given Group. diff --git a/src/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php b/src/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php index 6e543df753..4f7448c1f0 100644 --- a/src/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php +++ b/src/lib/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php @@ -547,16 +547,18 @@ public function loadGroupDataByIdentifier(string $identifier): array return $query->execute()->fetchAll(FetchMode::ASSOCIATIVE); } - public function loadAllGroupsData(): array + public function loadAllGroupsData(bool $includeSystem = false): array { $query = $this->createGroupLoadQuery(); - $query->andWhere( - $query->expr()->eq( - 'is_system', - $query->createPositionalParameter(false, ParameterType::BOOLEAN) - ) - ); + if (!$includeSystem) { + $query->andWhere( + $query->expr()->eq( + 'is_system', + $query->createPositionalParameter(false, ParameterType::BOOLEAN) + ) + ); + } return $query->execute()->fetchAll(FetchMode::ASSOCIATIVE); } diff --git a/src/lib/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php b/src/lib/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php index 0297acb752..690ac8fdd6 100644 --- a/src/lib/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php +++ b/src/lib/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php @@ -113,10 +113,10 @@ public function loadGroupDataByIdentifier(string $identifier): array } } - public function loadAllGroupsData(): array + public function loadAllGroupsData(bool $includeSystem = false): array { try { - return $this->innerGateway->loadAllGroupsData(); + return $this->innerGateway->loadAllGroupsData($includeSystem); } catch (DBALException | PDOException $e) { throw DatabaseException::wrap($e); } diff --git a/src/lib/Persistence/Legacy/Content/Type/Handler.php b/src/lib/Persistence/Legacy/Content/Type/Handler.php index bac6182fab..98acc06699 100644 --- a/src/lib/Persistence/Legacy/Content/Type/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Type/Handler.php @@ -168,10 +168,10 @@ public function loadGroupByIdentifier($identifier) /** * @return \Ibexa\Contracts\Core\Persistence\Content\Type\Group[] */ - public function loadAllGroups() + public function loadAllGroups(bool $includeSystem = false) { return $this->mapper->extractGroupsFromRows( - $this->contentTypeGateway->loadAllGroupsData() + $this->contentTypeGateway->loadAllGroupsData($includeSystem) ); } diff --git a/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php b/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php index 2b880e1f86..ad076949e2 100644 --- a/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php +++ b/src/lib/Persistence/Legacy/Content/Type/MemoryCachingHandler.php @@ -53,6 +53,7 @@ public function createGroup(GroupCreateStruct $createStruct): Group $this->storeGroupCache([$group]); $this->cache->deleteMulti([ $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [], true), + $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [true], true), ]); return $group; @@ -64,6 +65,7 @@ public function updateGroup(GroupUpdateStruct $struct): Group $this->storeGroupCache([$group]); $this->cache->deleteMulti([ $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [], true), + $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [true], true), ]); return $group; @@ -76,6 +78,7 @@ public function deleteGroup($groupId): void $this->cache->deleteMulti([ $this->generator->generateKey(self::CONTENT_TYPE_GROUP, [$groupId], true), $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [], true), + $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [true], true), ]); } @@ -139,13 +142,13 @@ public function loadGroupByIdentifier($identifier): Group /** * @return \Ibexa\Contracts\Core\Persistence\Content\Type\Group[] */ - public function loadAllGroups(): array + public function loadAllGroups(bool $includeSystem = false): array { - $contentTypeGroupListKey = $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [], true); + $contentTypeGroupListKey = $this->generator->generateKey(self::CONTENT_TYPE_GROUP_LIST, [$includeSystem], true); $groups = $this->cache->get($contentTypeGroupListKey); if ($groups === null) { - $groups = $this->innerHandler->loadAllGroups(); + $groups = $this->innerHandler->loadAllGroups($includeSystem); $this->storeGroupCache($groups, $contentTypeGroupListKey); } diff --git a/src/lib/Repository/ContentTypeService.php b/src/lib/Repository/ContentTypeService.php index 703d5a1de4..225cd56b9d 100644 --- a/src/lib/Repository/ContentTypeService.php +++ b/src/lib/Repository/ContentTypeService.php @@ -206,9 +206,9 @@ public function loadContentTypeGroupByIdentifier(string $contentTypeGroupIdentif /** * {@inheritdoc} */ - public function loadContentTypeGroups(array $prioritizedLanguages = []): iterable + public function loadContentTypeGroups(array $prioritizedLanguages = [], bool $includeSystem = false): iterable { - $spiGroups = $this->contentTypeHandler->loadAllGroups(); + $spiGroups = $this->contentTypeHandler->loadAllGroups($includeSystem); $groups = []; foreach ($spiGroups as $spiGroup) { diff --git a/src/lib/Repository/SiteAccessAware/ContentTypeService.php b/src/lib/Repository/SiteAccessAware/ContentTypeService.php index c2348f5032..c259ba12d6 100644 --- a/src/lib/Repository/SiteAccessAware/ContentTypeService.php +++ b/src/lib/Repository/SiteAccessAware/ContentTypeService.php @@ -66,11 +66,11 @@ public function loadContentTypeGroupByIdentifier(string $contentTypeGroupIdentif return $this->service->loadContentTypeGroupByIdentifier($contentTypeGroupIdentifier, $prioritizedLanguages); } - public function loadContentTypeGroups(?array $prioritizedLanguages = null): iterable + public function loadContentTypeGroups(?array $prioritizedLanguages = null, bool $includeSystem = false): iterable { $prioritizedLanguages = $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages); - return $this->service->loadContentTypeGroups($prioritizedLanguages); + return $this->service->loadContentTypeGroups($prioritizedLanguages, $includeSystem); } public function updateContentTypeGroup(ContentTypeGroup $contentTypeGroup, ContentTypeGroupUpdateStruct $contentTypeGroupUpdateStruct): void diff --git a/tests/integration/Core/Repository/ContentTypeServiceTest.php b/tests/integration/Core/Repository/ContentTypeServiceTest.php index d5b47f6b9a..6e1ffdd9cc 100644 --- a/tests/integration/Core/Repository/ContentTypeServiceTest.php +++ b/tests/integration/Core/Repository/ContentTypeServiceTest.php @@ -42,7 +42,6 @@ class ContentTypeServiceTest extends BaseContentTypeServiceTest /** * Test for the newContentTypeGroupCreateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeGroupCreateStruct() * @group user */ public function testNewContentTypeGroupCreateStruct() @@ -68,7 +67,6 @@ public function testNewContentTypeGroupCreateStruct() /** * Test for the newContentTypeGroupCreateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeGroupCreateStruct() * @depends testNewContentTypeGroupCreateStruct */ public function testNewContentTypeGroupCreateStructValues($createStruct) @@ -89,7 +87,6 @@ public function testNewContentTypeGroupCreateStructValues($createStruct) /** * Test for the createContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() * @depends testNewContentTypeGroupCreateStruct * @group user */ @@ -132,7 +129,6 @@ public function testCreateContentTypeGroup() /** * Test for the createContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() * @depends testCreateContentTypeGroup */ public function testCreateContentTypeGroupStructValues(array $data) @@ -164,7 +160,6 @@ public function testCreateContentTypeGroupStructValues(array $data) /** * Test for the createContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() * @depends testCreateContentTypeGroupStructValues */ public function testCreateContentTypeGroupStructLanguageDependentValues(array $data) @@ -184,7 +179,6 @@ public function testCreateContentTypeGroupStructLanguageDependentValues(array $d /** * Test for the createContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup * @depends testCreateContentTypeGroup */ public function testCreateContentTypeGroupThrowsInvalidArgumentException() @@ -209,7 +203,6 @@ public function testCreateContentTypeGroupThrowsInvalidArgumentException() /** * Test for the loadContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroup() * @depends testCreateContentTypeGroup * @group user */ @@ -253,7 +246,6 @@ public function testLoadSystemContentTypeGroup(): void /** * Test for the loadContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroup() * @depends testLoadContentTypeGroup */ public function testLoadContentTypeGroupStructValues(ContentTypeGroup $group) @@ -273,8 +265,6 @@ public function testLoadContentTypeGroupStructValues(ContentTypeGroup $group) /** * Test for the loadContentTypeGroup() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroup() */ public function testLoadContentTypeGroupThrowsNotFoundException() { @@ -289,7 +279,6 @@ public function testLoadContentTypeGroupThrowsNotFoundException() /** * Test for the loadContentTypeGroupByIdentifier() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroupByIdentifier() * @group user * @group field-type */ @@ -316,7 +305,6 @@ public function testLoadContentTypeGroupByIdentifier() /** * Test for the loadContentTypeGroupByIdentifier() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroupByIdentifier() * @depends testLoadContentTypeGroupByIdentifier */ public function testLoadContentTypeGroupByIdentifierStructValues(ContentTypeGroup $group) @@ -333,7 +321,6 @@ public function testLoadContentTypeGroupByIdentifierStructValues(ContentTypeGrou /** * Test for the loadContentTypeGroupByIdentifier() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroupByIdentifier() * @depends testLoadContentTypeGroupByIdentifier */ public function testLoadContentTypeGroupByIdentifierThrowsNotFoundException() @@ -355,7 +342,6 @@ public function testLoadContentTypeGroupByIdentifierThrowsNotFoundException() /** * Test for the loadContentTypeGroups() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroups() * @depends testCreateContentTypeGroup */ public function testLoadContentTypeGroups() @@ -393,7 +379,6 @@ public function testLoadContentTypeGroups() /** * Test for the loadContentTypeGroups() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeGroups() * @depends testLoadContentTypeGroups */ public function testLoadContentTypeGroupsIdentifiers($groups) @@ -422,10 +407,49 @@ public function testLoadContentTypeGroupsIdentifiers($groups) ); } + /** + * Test that system ContentTypeGroups are returned only when explicitly requested. + */ + public function testLoadContentTypeGroupsIncludeSystem(): void + { + $repository = $this->getRepository(); + $contentTypeService = $repository->getContentTypeService(); + + $systemGroupIdentifier = 'SystemGroup'; + $contentTypeGroupCreateStruct = $contentTypeService->newContentTypeGroupCreateStruct($systemGroupIdentifier); + $contentTypeGroupCreateStruct->isSystem = true; + + $systemGroup = $contentTypeService->createContentTypeGroup($contentTypeGroupCreateStruct); + + try { + $defaultGroupsIterable = $contentTypeService->loadContentTypeGroups(); + if (is_array($defaultGroupsIterable)) { + $defaultGroupsIterable = new \ArrayIterator($defaultGroupsIterable); + } + /** @var \Traversable $defaultGroupsIterable */ + $defaultGroups = iterator_to_array($defaultGroupsIterable); + /** @var \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup[] $defaultGroups */ + $defaultIdentifiers = array_map(static fn (ContentTypeGroup $group): string => $group->identifier, $defaultGroups); + + self::assertNotContains($systemGroupIdentifier, $defaultIdentifiers); + + $allGroupsIterable = $contentTypeService->loadContentTypeGroups([], true); + if (is_array($allGroupsIterable)) { + $allGroupsIterable = new \ArrayIterator($allGroupsIterable); + } + /** @var \Traversable $allGroupsIterable */ + $allGroups = iterator_to_array($allGroupsIterable); + /** @var \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup[] $allGroups */ + $allIdentifiers = array_map(static fn (ContentTypeGroup $group): string => $group->identifier, $allGroups); + + self::assertContains($systemGroupIdentifier, $allIdentifiers); + } finally { + $contentTypeService->deleteContentTypeGroup($systemGroup); + } + } + /** * Test for the newContentTypeGroupUpdateStruct() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeGroupUpdateStruct() */ public function testNewContentTypeGroupUpdateStruct() { @@ -446,7 +470,6 @@ public function testNewContentTypeGroupUpdateStruct() /** * Test for the updateContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() * @depends testCreateContentTypeGroup */ public function testUpdateContentTypeGroup() @@ -498,7 +521,6 @@ public function testUpdateContentTypeGroup() /** * Test for the updateContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() * @depends testUpdateContentTypeGroup */ public function testUpdateContentTypeGroupStructValues(array $data) @@ -520,7 +542,6 @@ public function testUpdateContentTypeGroupStructValues(array $data) /** * Test for the updateContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() * @depends testUpdateContentTypeGroupStructValues */ public function testUpdateContentTypeGroupStructLanguageDependentValues(array $data) @@ -544,7 +565,6 @@ public function testUpdateContentTypeGroupStructLanguageDependentValues(array $d /** * Test for the updateContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup * @depends testUpdateContentTypeGroup */ public function testUpdateContentTypeGroupThrowsInvalidArgumentException() @@ -572,7 +592,6 @@ public function testUpdateContentTypeGroupThrowsInvalidArgumentException() /** * Test for the deleteContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup * @depends testLoadContentTypeGroup */ public function testDeleteContentTypeGroup() @@ -633,7 +652,6 @@ public function testDeleteContentTypeGroupWithOrphanedContentTypeDrafts(): void /** * Test for the newContentTypeCreateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeCreateStruct() * @group user * @group field-type */ @@ -660,7 +678,6 @@ public function testNewContentTypeCreateStruct() /** * Test for the newContentTypeCreateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeCreateStruct() * @depends testNewContentTypeCreateStruct */ public function testNewContentTypeCreateStructValues($createStruct) @@ -688,7 +705,6 @@ public function testNewContentTypeCreateStructValues($createStruct) /** * Test for the newFieldDefinitionCreateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newFieldDefinitionCreateStruct() * @group user * @group field-type */ @@ -713,7 +729,6 @@ public function testNewFieldDefinitionCreateStruct() /** * Test for the newFieldDefinitionCreateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newFieldDefinitionCreateStruct() * @depends testNewFieldDefinitionCreateStruct */ public function testNewFieldDefinitionCreateStructValues($createStruct) @@ -741,7 +756,6 @@ public function testNewFieldDefinitionCreateStructValues($createStruct) /** * Test for the deleteContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() * @depends testDeleteContentTypeGroup */ public function testDeleteContentTypeGroupThrowsInvalidArgumentException() @@ -763,7 +777,6 @@ public function testDeleteContentTypeGroupThrowsInvalidArgumentException() /** * Test for the createContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() * @depends testNewContentTypeCreateStruct * @depends testNewFieldDefinitionCreateStruct * @depends testLoadContentTypeGroupByIdentifier @@ -872,7 +885,6 @@ public function testCreateContentType() /** * Test for the createContentType() method struct values. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType * @depends testCreateContentType * * @param array $data @@ -1007,7 +1019,6 @@ protected function assertContentTypeGroupsCorrect($expectedGroups, $actualGroups /** * Test for the createContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() * @depends testCreateContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateIdentifier() @@ -1041,7 +1052,6 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateIden * Test for the createContentType() method trying to create content type with already existing * remoteId. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() * @depends testCreateContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateRemoteId() @@ -1075,7 +1085,6 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateRemo /** * Test for the createContentType() method creating content with duplicate field identifiers. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType * @depends testCreateContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateFieldIdentifier() @@ -1113,7 +1122,6 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateFiel * existing identifier. * * @depends testCreateContentType - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType */ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateContentTypeIdentifier() { @@ -1150,7 +1158,6 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionDuplicateCont /** * Test for the createContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() * @depends testCreateContentType */ public function testCreateContentTypeThrowsContentTypeFieldDefinitionValidationException() @@ -1209,7 +1216,6 @@ public function testCreateContentTypeThrowsContentTypeFieldDefinitionValidationE * Test for the createContentTypeGroup() method called with no groups. * * @depends testCreateContentType - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup */ public function testCreateContentTypeThrowsInvalidArgumentExceptionGroupsEmpty() { @@ -1232,8 +1238,6 @@ public function testCreateContentTypeThrowsInvalidArgumentExceptionGroupsEmpty() /** * Test for the newContentTypeUpdateStruct() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeUpdateStruct() */ public function testNewContentTypeUpdateStruct() { @@ -1256,7 +1260,6 @@ public function testNewContentTypeUpdateStruct() /** * Test for the newContentTypeUpdateStruct() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeUpdateStruct() * @depends testNewContentTypeUpdateStruct */ public function testNewContentTypeUpdateStructValues($typeUpdate) @@ -1272,7 +1275,6 @@ public function testNewContentTypeUpdateStructValues($typeUpdate) /** * Test for the loadContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeDraft() * @depends testCreateContentType */ public function testLoadContentTypeDraft() @@ -1297,7 +1299,6 @@ public function testLoadContentTypeDraft() /** * Test for the loadContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeDraft() * @depends testLoadContentTypeDraft */ public function testLoadContentTypeDraftThrowsNotFoundException() @@ -1317,8 +1318,6 @@ public function testLoadContentTypeDraftThrowsNotFoundException() /** * Test for the loadContentTypeDraft() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeDraft() */ public function testLoadContentTypeDraftThrowsNotFoundExceptionIfDiffrentOwner() { @@ -1338,8 +1337,6 @@ public function testLoadContentTypeDraftThrowsNotFoundExceptionIfDiffrentOwner() /** * Test for the loadContentTypeDraft() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeDraft() */ public function testCanLoadContentTypeDraftEvenIfDiffrentOwner() { @@ -1360,8 +1357,6 @@ public function testCanLoadContentTypeDraftEvenIfDiffrentOwner() /** * Test for the updateContentTypeDraft() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() */ public function testUpdateContentTypeDraft() { @@ -1413,7 +1408,6 @@ public function testUpdateContentTypeDraft() /** * Test for the updateContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() * @depends testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftStructValues($data) @@ -1455,8 +1449,6 @@ public function testUpdateContentTypeDraftStructValues($data) } /** - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft - * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ForbiddenException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException @@ -1497,7 +1489,6 @@ public function testUpdateContentTypeDraftWithNewTranslation() /** * Test for the updateContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() * @depends testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicateIdentifier() @@ -1521,7 +1512,6 @@ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicat /** * Test for the updateContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft() * @depends testUpdateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicateRemoteId() @@ -1546,7 +1536,6 @@ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionDuplicat * Test for the updateContentTypeDraft() method. * * @depends testUpdateContentTypeDraft - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft */ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionNoDraftForAuthenticatedUser() { @@ -1583,7 +1572,6 @@ public function testUpdateContentTypeDraftThrowsInvalidArgumentExceptionNoDraftF * * @return array * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testCreateContentType */ public function testAddFieldDefinition() @@ -1637,7 +1625,6 @@ public function testAddFieldDefinition() /** * Test for the addFieldDefinition() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinition */ public function testAddFieldDefinitionStructValues(array $data) @@ -1664,7 +1651,6 @@ public function testAddFieldDefinitionStructValues(array $data) /** * Test for the addFieldDefinition() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFieldIdentifier() @@ -1690,7 +1676,6 @@ public function testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFie * Testing that field definition of non-repeatable field type can not be added multiple * times to the same ContentType. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsContentTypeFieldDefinitionValidationException() @@ -1749,7 +1734,6 @@ public function testAddFieldDefinitionThrowsContentTypeFieldDefinitionValidation * Testing that field definition of non-repeatable field type can not be added multiple * times to the same ContentType. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsBadStateExceptionNonRepeatableField() @@ -1790,8 +1774,6 @@ public function testAddFieldDefinitionThrowsBadStateExceptionNonRepeatableField( * * Testing that field definition of non-repeatable field type can not be added multiple * times to the same ContentTypeCreateStruct. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() */ public function testCreateContentThrowsContentTypeValidationException() { @@ -1844,7 +1826,6 @@ public function testCreateContentThrowsContentTypeValidationException() * Testing adding field definition of the field type that can not be added to the ContentType that * already has Content instances. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinition */ public function testAddFieldDefinitionThrowsBadStateExceptionContentInstances() @@ -1885,7 +1866,6 @@ public function testAddFieldDefinitionThrowsBadStateExceptionContentInstances() * * @return array * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() * @depends testCreateContentType */ public function testRemoveFieldDefinition() @@ -1919,7 +1899,6 @@ public function testRemoveFieldDefinition() * * @param array $data * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() * @depends testRemoveFieldDefinition */ public function testRemoveFieldDefinitionRemoved(array $data) @@ -1942,7 +1921,6 @@ public function testRemoveFieldDefinitionRemoved(array $data) /** * Test for the removeFieldDefinition() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() * @depends testRemoveFieldDefinition */ public function testRemoveFieldDefinitionThrowsInvalidArgumentException() @@ -1969,7 +1947,6 @@ public function testRemoveFieldDefinitionThrowsInvalidArgumentException() * Test removeFieldDefinition() method for field in a different draft throws an exception. * * @depends testRemoveFieldDefinition - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition */ public function testRemoveFieldDefinitionThrowsInvalidArgumentExceptionOnWrongDraft() { @@ -1990,7 +1967,6 @@ public function testRemoveFieldDefinitionThrowsInvalidArgumentExceptionOnWrongDr /** * Test for the removeFieldDefinition() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition() * @depends testRemoveFieldDefinition */ public function testRemoveFieldDefinitionRemovesFieldFromContent() @@ -2060,7 +2036,6 @@ public function testRemoveFieldDefinitionRemovesFieldFromContent() * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content[] $data * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeFieldDefinition * @depends testRemoveFieldDefinitionRemovesFieldFromContent */ public function testRemoveFieldDefinitionRemovesFieldFromContentRemoved($data) @@ -2088,7 +2063,6 @@ public function testRemoveFieldDefinitionRemovesFieldFromContentRemoved($data) /** * Test for the addFieldDefinition() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinition */ public function testAddFieldDefinitionAddsFieldToContent() @@ -2179,7 +2153,6 @@ public function testAddFieldDefinitionAddsFieldToContent() * * @param \Ibexa\Contracts\Core\Repository\Values\Content\Content[] $data * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::addFieldDefinition() * @depends testAddFieldDefinitionAddsFieldToContent */ public function testAddFieldDefinitionAddsFieldToContentAdded(array $data) @@ -2215,8 +2188,6 @@ public function testAddFieldDefinitionAddsFieldToContentAdded(array $data) /** * Test for the newFieldDefinitionUpdateStruct() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newFieldDefinitionUpdateStruct() */ public function testNewFieldDefinitionUpdateStruct() { @@ -2240,7 +2211,6 @@ public function testNewFieldDefinitionUpdateStruct() * Test for the newFieldDefinitionUpdateStruct() method. * * @depends testNewFieldDefinitionUpdateStruct - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::newContentTypeUpdateStruct * * @param \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionUpdateStruct $fieldDefinitionUpdateStruct */ @@ -2259,7 +2229,6 @@ public function testNewFieldDefinitionUpdateStructValues($fieldDefinitionUpdateS * * @return array * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() * @depends testLoadContentTypeDraft */ public function testUpdateFieldDefinition() @@ -2313,9 +2282,6 @@ public function testUpdateFieldDefinition() ]; } - /** - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition - */ public function testUpdateFieldDefinitionWithNewTranslation() { $repository = $this->getRepository(); @@ -2382,7 +2348,6 @@ public function testUpdateFieldDefinitionWithNewTranslation() * * @param array $data * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() * @depends testUpdateFieldDefinition */ public function testUpdateFieldDefinitionStructValues(array $data) @@ -2413,9 +2378,6 @@ public function testUpdateFieldDefinitionStructValues(array $data) /** * Test for the updateFieldDefinition() method using an empty FieldDefinitionUpdateStruct. - * - * @covers \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionUpdateStruct - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition */ public function testUpdateFieldDefinitionWithEmptyStruct() { @@ -2442,8 +2404,6 @@ public function testUpdateFieldDefinitionWithEmptyStruct() /** * Test for the updateFieldDefinition() method with already defined field identifier. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition */ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionFieldIdentifierExists() { @@ -2474,7 +2434,6 @@ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionFieldIden /** * Test for the updateFieldDefinition() method trying to update non-existent field. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateFieldDefinition() * @depends testLoadContentTypeDraft */ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionForUndefinedField() @@ -2507,7 +2466,6 @@ public function testUpdateFieldDefinitionThrowsInvalidArgumentExceptionForUndefi /** * Test for the publishContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() * @depends testLoadContentTypeDraft */ public function testPublishContentTypeDraft() @@ -2537,7 +2495,6 @@ public function testPublishContentTypeDraft() * Test for the publishContentTypeDraft() method setting proper ContentType nameSchema. * * @depends testPublishContentTypeDraft - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft */ public function testPublishContentTypeDraftSetsNameSchema() { @@ -2572,8 +2529,6 @@ public function testPublishContentTypeDraftSetsNameSchema() /** * Test that publishing content type Draft refreshes list of content types in content type groups. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft */ public function testPublishContentTypeDraftRefreshesContentTypesList() { @@ -2627,7 +2582,6 @@ static function (ContentType $contentType) { /** * Test for the publishContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() * @depends testPublishContentTypeDraft */ public function testPublishContentTypeDraftThrowsBadStateException() @@ -2650,7 +2604,6 @@ public function testPublishContentTypeDraftThrowsBadStateException() /** * Test for the createContentTypeGroup() method trying to create content type without any fields. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::publishContentTypeDraft() * @depends testPublishContentTypeDraft */ public function testPublishContentTypeDraftThrowsInvalidArgumentExceptionWithoutFields() @@ -2684,7 +2637,6 @@ public function testPublishContentTypeDraftThrowsInvalidArgumentExceptionWithout /** * Test for the loadContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() * @depends testCreateContentType * @group user * @group field-type @@ -2765,7 +2717,6 @@ public function getPrioritizedLanguageList() /** * Test for the loadContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() * @depends testLoadContentType */ public function testLoadContentTypeStructValues($userGroupType) @@ -2806,7 +2757,6 @@ public function testLoadContentTypeStructValues($userGroupType) /** * Test for the loadContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() * @depends testLoadContentTypeStructValues */ public function testLoadContentTypeFieldDefinitions(APIFieldDefinitionCollection $fieldDefinitions) @@ -2901,7 +2851,6 @@ static function ($fieldDefinition) { /** * Test for the loadContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentType() * @depends testLoadContentType */ public function testLoadContentTypeThrowsNotFoundException() @@ -2924,7 +2873,6 @@ public function testLoadContentTypeThrowsNotFoundException() * * @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByIdentifier() * @depends testLoadContentType * @group user */ @@ -2951,7 +2899,6 @@ public function testLoadContentTypeByIdentifier() * * @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByIdentifier() * @depends testLoadContentTypeByIdentifier */ public function testLoadContentTypeByIdentifierReturnsCorrectInstance($contentType) @@ -2968,7 +2915,6 @@ public function testLoadContentTypeByIdentifierReturnsCorrectInstance($contentTy /** * Test for the loadContentTypeByIdentifier() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByIdentifier() * @depends testLoadContentTypeByIdentifier */ public function testLoadContentTypeByIdentifierThrowsNotFoundException() @@ -2988,7 +2934,6 @@ public function testLoadContentTypeByIdentifierThrowsNotFoundException() /** * Test for the loadContentTypeByRemoteId() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByRemoteId() * @depends testLoadContentType */ public function testLoadContentTypeByRemoteId() @@ -3015,7 +2960,6 @@ public function testLoadContentTypeByRemoteId() /** * Test for the loadContentTypeByRemoteId() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByRemoteId() * @depends testLoadContentTypeByRemoteId */ public function testLoadContentTypeByRemoteIdReturnsCorrectInstance($contentType) @@ -3032,7 +2976,6 @@ public function testLoadContentTypeByRemoteIdReturnsCorrectInstance($contentType /** * Test for the loadContentTypeByRemoteId() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeByRemoteId() * @depends testLoadContentType */ public function testLoadContentTypeByRemoteIdThrowsNotFoundException() @@ -3052,7 +2995,6 @@ public function testLoadContentTypeByRemoteIdThrowsNotFoundException() /** * Test for the loadContentTypeList() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypeList() * @depends testLoadContentType */ public function testLoadContentTypeList() @@ -3076,7 +3018,6 @@ public function testLoadContentTypeList() /** * Test for the loadContentTypes() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypes() * @depends testLoadContentType */ public function testLoadContentTypes() @@ -3102,7 +3043,6 @@ public function testLoadContentTypes() /** * Test for the loadContentTypes() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::loadContentTypes() * @depends testLoadContentTypes */ public function testLoadContentTypesContent(array $types) @@ -3132,7 +3072,6 @@ static function ($a, $b) { /** * Test for the createContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() * @depends testLoadContentType */ public function testCreateContentTypeDraft() @@ -3161,7 +3100,6 @@ public function testCreateContentTypeDraft() /** * Test for the createContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() * @depends testCreateContentTypeDraft */ public function testCreateContentTypeDraftStructValues(array $data) @@ -3213,7 +3151,6 @@ public function testCreateContentTypeDraftStructValues(array $data) /** * Test for the createContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() * @depends testCreateContentTypeDraftStructValues */ public function testCreateContentTypeDraftStructLanguageDependentValues(array $data) @@ -3236,7 +3173,6 @@ public function testCreateContentTypeDraftStructLanguageDependentValues(array $d /** * Test for the createContentTypeDraft() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeDraft() * @depends testCreateContentTypeDraft */ public function testCreateContentTypeDraftThrowsBadStateException() @@ -3260,7 +3196,6 @@ public function testCreateContentTypeDraftThrowsBadStateException() /** * Test for the deleteContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() * @depends testLoadContentTypeByIdentifier */ public function testDeleteContentType() @@ -3284,7 +3219,6 @@ public function testDeleteContentType() /** * Test for the deleteContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() * @depends testDeleteContentType */ public function testDeleteContentTypeThrowsBadStateException() @@ -3309,7 +3243,6 @@ public function testDeleteContentTypeThrowsBadStateException() * * @return array * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() * @depends testLoadContentTypeByIdentifier */ public function testCopyContentType() @@ -3355,7 +3288,6 @@ public function testCopyContentType() * * @param array $data * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() * @depends testCopyContentType */ public function testCopyContentTypeStructValues(array $data) @@ -3445,7 +3377,6 @@ private function assertCopyContentTypeValues($originalType, $copiedType, $exclud /** * Test for the copyContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType($contentType, $user) * @depends testCopyContentType */ public function testCopyContentTypeWithSecondParameter() @@ -3476,7 +3407,6 @@ public function testCopyContentTypeWithSecondParameter() /** * Test for the assignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() * @depends testLoadContentTypeGroupByIdentifier * @depends testLoadContentTypeByIdentifier * @depends testLoadContentType @@ -3512,7 +3442,6 @@ public function testAssignContentTypeGroup() /** * Test for the assignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() * @depends testAssignContentTypeGroup */ public function testAssignContentTypeGroupThrowsInvalidArgumentException() @@ -3537,7 +3466,6 @@ public function testAssignContentTypeGroupThrowsInvalidArgumentException() /** * Test for the unassignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() * @depends testAssignContentTypeGroup */ public function testUnassignContentTypeGroup() @@ -3575,7 +3503,6 @@ public function testUnassignContentTypeGroup() /** * Test for the unassignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() * @depends testUnassignContentTypeGroup */ public function testUnassignContentTypeGroupThrowsInvalidArgumentException() @@ -3598,7 +3525,6 @@ public function testUnassignContentTypeGroupThrowsInvalidArgumentException() /** * Test for the unassignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::unassignContentTypeGroup() * @depends testUnassignContentTypeGroup */ public function testUnassignContentTypeGroupThrowsBadStateException() @@ -3623,7 +3549,6 @@ public function testUnassignContentTypeGroupThrowsBadStateException() /** * Test for the createContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() * @depends testLoadContentTypeGroup * @depends testCreateContentTypeGroup */ @@ -3669,7 +3594,6 @@ public function testCreateContentTypeGroupInTransactionWithRollback() /** * Test for the createContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentTypeGroup() * @depends testLoadContentTypeGroup * @depends testCreateContentTypeGroup */ @@ -3711,7 +3635,6 @@ public function testCreateContentTypeGroupInTransactionWithCommit() /** * Test for the updateContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() * @depends testUpdateContentTypeGroup * @depends testLoadContentTypeGroupByIdentifier */ @@ -3754,7 +3677,6 @@ public function testUpdateContentTypeGroupInTransactionWithRollback() /** * Test for the updateContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeGroup() * @depends testUpdateContentTypeGroup * @depends testLoadContentTypeGroupByIdentifier */ @@ -3799,7 +3721,6 @@ public function testUpdateContentTypeGroupInTransactionWithCommit() /** * Test for the deleteContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() * @depends testDeleteContentTypeGroup * @depends testLoadContentTypeGroupByIdentifierThrowsNotFoundException */ @@ -3847,7 +3768,6 @@ public function testDeleteContentTypeGroupWithRollback() /** * Test for the deleteContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentTypeGroup() * @depends testDeleteContentTypeGroup * @depends testLoadContentTypeGroupByIdentifierThrowsNotFoundException */ @@ -3895,7 +3815,6 @@ public function testDeleteContentTypeGroupWithCommit() /** * Test for the createContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() * @depends testCreateContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -3955,7 +3874,6 @@ public function testCreateContentTypeInTransactionWithRollback() /** * Test for the createContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::createContentType() * @depends testCreateContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4011,7 +3929,6 @@ public function testCreateContentTypeInTransactionWithCommit() /** * Test for the copyContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() * @depends testCopyContentType * @depends testLoadContentTypeByIdentifier * @depends testLoadContentTypeThrowsNotFoundException @@ -4055,7 +3972,6 @@ public function testCopyContentTypeInTransactionWithRollback() /** * Test for the copyContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::copyContentType() * @depends testCopyContentType * @depends testLoadContentTypeByIdentifier * @depends testLoadContentTypeThrowsNotFoundException @@ -4095,7 +4011,6 @@ public function testCopyContentTypeInTransactionWithCommit() /** * Test for the deleteContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() * @depends testCopyContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4134,7 +4049,6 @@ public function testDeleteContentTypeInTransactionWithRollback() /** * Test for the deleteContentType() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteContentType() * @depends testCopyContentType * @depends testLoadContentTypeByIdentifierThrowsNotFoundException */ @@ -4177,7 +4091,6 @@ public function testDeleteContentTypeInTransactionWithCommit() /** * Test for the assignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() * @depends testAssignContentTypeGroup */ public function testAssignContentTypeGroupInTransactionWithRollback() @@ -4223,7 +4136,6 @@ public function testAssignContentTypeGroupInTransactionWithRollback() /** * Test for the assignContentTypeGroup() method. * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::assignContentTypeGroup() * @depends testAssignContentTypeGroup */ public function testAssignContentTypeGroupInTransactionWithCommit() @@ -4268,8 +4180,6 @@ public function testAssignContentTypeGroupInTransactionWithCommit() /** * Test for the isContentTypeUsed() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::isContentTypeUsed() */ public function testIsContentTypeUsed() { @@ -4290,8 +4200,6 @@ public function testIsContentTypeUsed() } /** - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeContentTypeTranslation - * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException @@ -4332,8 +4240,6 @@ public function testRemoveContentTypeTranslation() } /** - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::removeContentTypeTranslation - * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException @@ -4395,8 +4301,6 @@ public function testRemoveContentTypeTranslationWithMultilingualData() } /** - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::updateContentTypeDraft - * * @throws \Ibexa\Contracts\Core\Repository\Exceptions\ForbiddenException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException @@ -4527,8 +4431,6 @@ public function testUpdateContentTypeDraftWithNewTranslationWithMultilingualData /** * Test for the deleteUserDrafts() method. - * - * @covers \Ibexa\Contracts\Core\Repository\ContentTypeService::deleteUserDrafts() */ public function testDeleteUserDrafts() { diff --git a/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php b/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php index 6b113e3fb8..297fadaaca 100644 --- a/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php +++ b/tests/lib/Persistence/Cache/ContentTypeHandlerTest.php @@ -40,20 +40,41 @@ public function providerForUnCachedMethods(): array // string $method, array $arguments, array? $tagGeneratingArguments, array? $keyGeneratingArguments, array? $tags, array? $key, ?mixed $returnValue return [ - ['createGroup', [new SPITypeGroupCreateStruct()], null, [['content_type_group_list', [], true]], null, ['ibx-ctgl']], + [ + 'createGroup', + [new SPITypeGroupCreateStruct()], + null, + [ + ['content_type_group_list', [], true], + ['content_type_group_list', [true], true], + ], + null, + ['ibx-ctgl', 'ibx-ctgl-true'], + ], [ 'updateGroup', [$groupUpdate], null, [ ['content_type_group_list', [], true], + ['content_type_group_list', [true], true], ['content_type_group', [3], true], ['content_type_group_with_id_suffix', ['media'], true], ], null, - ['ibx-ctgl', 'ibx-ctg-3', 'ibx-ctg-media-bi'], + ['ibx-ctgl', 'ibx-ctgl-true', 'ibx-ctg-3', 'ibx-ctg-media-bi'], + ], + [ + 'deleteGroup', + [3], + [['type_group', [3], false]], + [ + ['content_type_group_list', [], true], + ['content_type_group_list', [true], true], + ], + ['tg-3'], + ['ibx-ctgl', 'ibx-ctgl-true'], ], - ['deleteGroup', [3], [['type_group', [3], false]], null, ['tg-3']], ['loadContentTypes', [3, 1]], // also listed for cached cases in providerForCachedLoadMethods ['load', [5, 1]], // also listed for cached case in providerForCachedLoadMethods [ @@ -202,7 +223,18 @@ public function providerForCachedLoadMethodsHit(): array ['ibx-ctg', 'bi'], $group, ], - ['loadAllGroups', [], 'ibx-ctgl', null, null, [['content_type_group_list', [], true]], ['ibx-ctgl'], [3 => $group]], + [ + 'loadAllGroups', + [], + 'ibx-ctgl', + null, + null, + [ + ['content_type_group_list', [false], true], + ], + ['ibx-ctgl'], + [3 => $group], + ], ['loadContentTypes', [3, 0], 'ibx-ctlbg-3', null, null, [['content_type_list_by_group', [3], true]], ['ibx-ctlbg-3'], [$type]], ['loadContentTypesByFieldDefinitionIdentifier', [3, 0], 'ibx-ctlbfdi-3', null, null, [['content_type_list_by_field_definition_identifier', [3], true]], ['ibx-ctlbfdi-3'], [$type]], ['loadContentTypeList', [[5]], 'ibx-ct-5', null, null, [['content_type', [], true]], ['ibx-ct'], [5 => $type], true], @@ -297,7 +329,7 @@ public function providerForCachedLoadMethodsMiss(): array ], ['tg-3'], [ - ['content_type_group_list', [], true], + ['content_type_group_list', [false], true], ], ['ibx-ctgl'], [3 => $group], diff --git a/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php b/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php index 23bf963870..bc2005f6ce 100644 --- a/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php +++ b/tests/lib/Persistence/Legacy/Content/Type/ContentTypeHandlerTest.php @@ -220,7 +220,8 @@ public function testLoadAllGroups() $gatewayMock = $this->getGatewayMock(); $gatewayMock->expects($this->once()) ->method('loadAllGroupsData') - ->will($this->returnValue([])); + ->with(false) + ->willReturn([]); $mapperMock = $this->getMapperMock(); $mapperMock->expects($this->once()) diff --git a/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php b/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php index 4c33354bad..529842d891 100644 --- a/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php +++ b/tests/lib/Repository/Decorator/ContentTypeServiceDecoratorTest.php @@ -84,7 +84,7 @@ public function testLoadContentTypeGroupsDecorator() $serviceMock = $this->createServiceMock(); $decoratedService = $this->createDecorator($serviceMock); - $parameters = [['prioritized_language_value']]; + $parameters = [['prioritized_language_value'], false]; $serviceMock->expects($this->once())->method('loadContentTypeGroups')->with(...$parameters); diff --git a/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php b/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php index 0ceeeafef1..bcbd42b0c0 100644 --- a/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php +++ b/tests/lib/Repository/SiteAccessAware/ContentTypeServiceTest.php @@ -117,7 +117,7 @@ public function providerForLanguagesLookupMethods() ['loadContentTypeGroupByIdentifier', ['content', self::LANG_ARG], $contentTypeGroup, 1], - ['loadContentTypeGroups', [self::LANG_ARG], [$contentTypeGroup], 0], + ['loadContentTypeGroups', [self::LANG_ARG, false], [$contentTypeGroup], 0], ['loadContentType', [22, self::LANG_ARG], $contentType, 1],