diff --git a/src/contracts/Persistence/Content/ContentInfo.php b/src/contracts/Persistence/Content/ContentInfo.php index 5d247fc73e..182871c947 100644 --- a/src/contracts/Persistence/Content/ContentInfo.php +++ b/src/contracts/Persistence/Content/ContentInfo.php @@ -43,6 +43,8 @@ class ContentInfo extends ValueObject */ public $contentTypeId; + public string $contentTypeIdentifier; + /** * Section id the content is assigned to. * @@ -134,6 +136,11 @@ class ContentInfo extends ValueObject * @var bool */ public $isHidden = false; + + public function getContentTypeIdentifier(): string + { + return $this->contentTypeIdentifier; + } } class_alias(ContentInfo::class, 'eZ\Publish\SPI\Persistence\Content\ContentInfo'); diff --git a/src/contracts/Repository/Events/Content/BeforeLoadContentEvent.php b/src/contracts/Repository/Events/Content/BeforeLoadContentEvent.php new file mode 100644 index 0000000000..c8910b5279 --- /dev/null +++ b/src/contracts/Repository/Events/Content/BeforeLoadContentEvent.php @@ -0,0 +1,90 @@ +contentId = $contentId; + $this->languages = $languages; + $this->versionNo = $versionNo; + $this->useAlwaysAvailable = $useAlwaysAvailable; + } + + public function getContentId(): int + { + return $this->contentId; + } + + /** + * @return string[]|null + */ + public function getLanguages(): ?array + { + return $this->languages; + } + + public function getVersionNo(): ?int + { + return $this->versionNo; + } + + public function getUseAlwaysAvailable(): bool + { + return $this->useAlwaysAvailable; + } + + public function getContent(): Content + { + if (!$this->hasContent()) { + throw new UnexpectedValueException( + sprintf( + 'Return value is not set or not of type %s. Check hasContent() or set it using setContent() before you call the getter.', + Content::class + ) + ); + } + + return $this->content; + } + + public function setContent(?Content $content): void + { + $this->content = $content; + } + + /** @phpstan-assert-if-true !null $this->content */ + public function hasContent(): bool + { + return $this->content instanceof Content; + } +} diff --git a/src/lib/Event/ContentService.php b/src/lib/Event/ContentService.php index dee89f597c..e17e2cf34f 100644 --- a/src/lib/Event/ContentService.php +++ b/src/lib/Event/ContentService.php @@ -20,6 +20,7 @@ use Ibexa\Contracts\Core\Repository\Events\Content\BeforeDeleteTranslationEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeDeleteVersionEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeHideContentEvent; +use Ibexa\Contracts\Core\Repository\Events\Content\BeforeLoadContentEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforePublishVersionEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeRevealContentEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeUpdateContentEvent; @@ -380,6 +381,31 @@ public function revealContent(ContentInfo $contentInfo): void new RevealContentEvent(...$eventData) ); } + + public function loadContent( + int $contentId, + array $languages = null, + ?int $versionNo = null, + bool $useAlwaysAvailable = true + ): Content { + $eventData = [ + $contentId, + $languages, + $versionNo, + $useAlwaysAvailable, + ]; + + $beforeEvent = new BeforeLoadContentEvent(...$eventData); + + $this->eventDispatcher->dispatch($beforeEvent); + if ($beforeEvent->isPropagationStopped()) { + return $beforeEvent->getContent(); + } + + return $beforeEvent->hasContent() + ? $beforeEvent->getContent() + : $this->innerService->loadContent($contentId, $languages, $versionNo, $useAlwaysAvailable); + } } class_alias(ContentService::class, 'eZ\Publish\Core\Event\ContentService'); diff --git a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php index 29d1569b52..68920d5d82 100644 --- a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php +++ b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php @@ -20,6 +20,7 @@ use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as LanguageHandler; use Ibexa\Contracts\Core\Persistence\Content\MetadataUpdateStruct; use Ibexa\Contracts\Core\Persistence\Content\Relation\CreateStruct as RelationCreateStruct; +use Ibexa\Contracts\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Persistence\Content\UpdateStruct; use Ibexa\Contracts\Core\Persistence\Content\VersionInfo; use Ibexa\Contracts\Core\Repository\Values\Content\Relation; @@ -769,14 +770,15 @@ private function internalLoadContent( 'a.data_text AS ezcontentobject_attribute_data_text', 'a.sort_key_int AS ezcontentobject_attribute_sort_key_int', 'a.sort_key_string AS ezcontentobject_attribute_sort_key_string', - 't.main_node_id AS ezcontentobject_tree_main_node_id' + 't.main_node_id AS ezcontentobject_tree_main_node_id', + 'ct.identifier AS content_type_identifier', ) ->from('ezcontentobject', 'c') ->innerJoin( 'c', 'ezcontentobject_version', 'v', - $expr->andX( + $expr->and( $expr->eq('c.id', 'v.contentobject_id'), $expr->eq('v.version', $version ?? 'c.current_version') ) @@ -785,7 +787,7 @@ private function internalLoadContent( 'v', 'ezcontentobject_attribute', 'a', - $expr->andX( + $expr->and( $expr->eq('v.contentobject_id', 'a.contentobject_id'), $expr->eq('v.version', 'a.version') ) @@ -794,10 +796,19 @@ private function internalLoadContent( 'c', 'ezcontentobject_tree', 't', - $expr->andX( + $expr->and( $expr->eq('c.id', 't.contentobject_id'), $expr->eq('t.node_id', 't.main_node_id') ) + ) + ->innerJoin( + 'c', + 'ezcontentclass', + 'ct', + $expr->and( + $expr->eq('c.contentclass_id', 'ct.id'), + $expr->eq('ct.version', Type::STATUS_DEFINED) + ) ); $queryBuilder->where( diff --git a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php index cdc28887e9..4b0f60ce0c 100644 --- a/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php +++ b/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php @@ -9,6 +9,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Query\QueryBuilder as DoctrineQueryBuilder; +use Ibexa\Contracts\Core\Persistence\Content\Type; use Ibexa\Core\Persistence\Legacy\Content\Gateway; use function time; @@ -113,13 +114,26 @@ public function createLoadContentInfoQueryBuilder( } $queryBuilder - ->select('c.*', 't.main_node_id AS ezcontentobject_tree_main_node_id') + ->select( + 'c.*', + 't.main_node_id AS ezcontentobject_tree_main_node_id', + 'ct.identifier AS content_type_identifier' + ) ->from(Gateway::CONTENT_ITEM_TABLE, 'c') ->leftJoin( 'c', 'ezcontentobject_tree', 't', $joinCondition + ) + ->innerJoin( + 'c', + 'ezcontentclass', + 'ct', + $expr->and( + $expr->eq('c.contentclass_id', 'ct.id'), + $expr->eq('ct.version', Type::STATUS_DEFINED) + ) ); return $queryBuilder; @@ -163,7 +177,8 @@ public function createVersionInfoFindQueryBuilder(): DoctrineQueryBuilder 'c.status AS ezcontentobject_status', 'c.name AS ezcontentobject_name', 'c.language_mask AS ezcontentobject_language_mask', - 'c.is_hidden AS ezcontentobject_is_hidden' + 'c.is_hidden AS ezcontentobject_is_hidden', + 'ct.identifier AS content_type_identifier' ) ->from(Gateway::CONTENT_VERSION_TABLE, 'v') ->innerJoin( @@ -180,6 +195,15 @@ public function createVersionInfoFindQueryBuilder(): DoctrineQueryBuilder $expr->eq('t.contentobject_id', 'v.contentobject_id'), $expr->eq('t.main_node_id', 't.node_id') ) + ) + ->innerJoin( + 'c', + 'ezcontentclass', + 'ct', + $expr->and( + $expr->eq('c.contentclass_id', 'ct.id'), + $expr->eq('ct.version', Type::STATUS_DEFINED) + ) ); return $query; diff --git a/src/lib/Persistence/Legacy/Content/Mapper.php b/src/lib/Persistence/Legacy/Content/Mapper.php index 3113470b28..29d1741075 100644 --- a/src/lib/Persistence/Legacy/Content/Mapper.php +++ b/src/lib/Persistence/Legacy/Content/Mapper.php @@ -370,12 +370,16 @@ private function loadCachedVersionFieldDefinitionsPerLanguage( * * @return \Ibexa\Contracts\Core\Persistence\Content\ContentInfo */ - public function extractContentInfoFromRow(array $row, $prefix = '', $treePrefix = 'ezcontentobject_tree_') - { + public function extractContentInfoFromRow( + array $row, + $prefix = '', + $treePrefix = 'ezcontentobject_tree_' + ) { $contentInfo = new ContentInfo(); $contentInfo->id = (int)$row["{$prefix}id"]; $contentInfo->name = (string)$row["{$prefix}name"]; $contentInfo->contentTypeId = (int)$row["{$prefix}contentclass_id"]; + $contentInfo->contentTypeIdentifier = (string)$row['content_type_identifier']; $contentInfo->sectionId = (int)$row["{$prefix}section_id"]; $contentInfo->currentVersionNo = (int)$row["{$prefix}current_version"]; $contentInfo->ownerId = (int)$row["{$prefix}owner_id"]; diff --git a/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php b/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php index 1fb0688ca2..7e7bdefa52 100644 --- a/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php +++ b/src/lib/Search/Legacy/Content/Gateway/DoctrineDatabase.php @@ -12,6 +12,7 @@ use Doctrine\DBAL\Query\QueryBuilder; use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as LanguageHandler; +use Ibexa\Contracts\Core\Persistence\Content\Type; use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo; use Ibexa\Core\Persistence\Legacy\Content\Gateway as ContentGateway; @@ -216,8 +217,9 @@ private function getContentInfoList( array $languageFilter ): array { $query = $this->connection->createQueryBuilder(); + $expr = $query->expr(); $query->select( - 'DISTINCT c.*, main_tree.main_node_id AS main_tree_main_node_id', + 'DISTINCT c.*, main_tree.main_node_id AS main_tree_main_node_id, ct.identifier AS content_type_identifier', ); if ($sort !== null) { @@ -236,10 +238,19 @@ private function getContentInfoList( 'c', LocationGateway::CONTENT_TREE_TABLE, 'main_tree', - $query->expr()->andX( + $expr->and( 'main_tree.contentobject_id = c.id', 'main_tree.main_node_id = main_tree.node_id' ) + ) + ->innerJoin( + 'c', + 'ezcontentclass', + 'ct', + $expr->and( + $expr->eq('c.contentclass_id', 'ct.id'), + $expr->eq('ct.version', Type::STATUS_DEFINED) + ) ); if ($sort !== null) { diff --git a/tests/lib/Event/AbstractServiceTest.php b/tests/lib/Event/AbstractServiceTest.php index 8dd461c73c..6f0633b599 100644 --- a/tests/lib/Event/AbstractServiceTest.php +++ b/tests/lib/Event/AbstractServiceTest.php @@ -15,11 +15,14 @@ abstract class AbstractServiceTest extends TestCase { - public function getEventDispatcher(string $beforeEventName, string $eventName): TraceableEventDispatcher + public function getEventDispatcher(string $beforeEventName, ?string $eventName): TraceableEventDispatcher { $eventDispatcher = new EventDispatcher(); $eventDispatcher->addListener($beforeEventName, static function (BeforeEvent $event) {}); - $eventDispatcher->addListener($eventName, static function (AfterEvent $event) {}); + if ($eventName !== null) { + $eventDispatcher->addListener($eventName, static function (AfterEvent $event) { + }); + } return new TraceableEventDispatcher( $eventDispatcher, diff --git a/tests/lib/Event/ContentServiceTest.php b/tests/lib/Event/ContentServiceTest.php index 3a5761249b..84fd020e88 100644 --- a/tests/lib/Event/ContentServiceTest.php +++ b/tests/lib/Event/ContentServiceTest.php @@ -17,6 +17,7 @@ use Ibexa\Contracts\Core\Repository\Events\Content\BeforeDeleteTranslationEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeDeleteVersionEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeHideContentEvent; +use Ibexa\Contracts\Core\Repository\Events\Content\BeforeLoadContentEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforePublishVersionEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeRevealContentEvent; use Ibexa\Contracts\Core\Repository\Events\Content\BeforeUpdateContentEvent; @@ -1153,6 +1154,97 @@ public function testRevealContentStopPropagationInBeforeEvents() [RevealContentEvent::class, 0], ]); } + + public function testLoadContentEvents(): void + { + $traceableEventDispatcher = $this->getEventDispatcher( + BeforeLoadContentEvent::class, + null + ); + + $content = $this->createMock(Content::class); + $innerServiceMock = $this->createMock(ContentServiceInterface::class); + $innerServiceMock->method('loadContent')->willReturn($content); + + $service = new ContentService($innerServiceMock, $traceableEventDispatcher); + $result = $service->loadContent(2, []); + + $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); + + $this->assertSame($content, $result); + $this->assertSame($calledListeners, [ + [BeforeLoadContentEvent::class, 0], + ]); + $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + } + + public function testReturnLoadContentResultInBeforeEvents(): void + { + $traceableEventDispatcher = $this->getEventDispatcher( + BeforeLoadContentEvent::class, + null + ); + + $parameters = [ + 2, + [], + null, + true, + ]; + + $content = $this->createMock(Content::class); + $eventContent = $this->createMock(Content::class); + $innerServiceMock = $this->createMock(ContentServiceInterface::class); + $innerServiceMock->method('loadContent')->willReturn($content); + + $traceableEventDispatcher->addListener(BeforeLoadContentEvent::class, static function (BeforeLoadContentEvent $event) use ($eventContent) { + $event->setContent($eventContent); + }, 10); + + $service = new ContentService($innerServiceMock, $traceableEventDispatcher); + $result = $service->loadContent(2, []); + + $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); + + $this->assertSame($eventContent, $result); + $this->assertSame($calledListeners, [ + [BeforeLoadContentEvent::class, 10], + [BeforeLoadContentEvent::class, 0], + ]); + $this->assertSame([], $traceableEventDispatcher->getNotCalledListeners()); + } + + public function testLoadContentStopPropagationInBeforeEvents(): void + { + $traceableEventDispatcher = $this->getEventDispatcher( + BeforeLoadContentEvent::class, + null + ); + + $content = $this->createMock(Content::class); + $eventContent = $this->createMock(Content::class); + $innerServiceMock = $this->createMock(ContentServiceInterface::class); + $innerServiceMock->method('loadContent')->willReturn($content); + + $traceableEventDispatcher->addListener(BeforeLoadContentEvent::class, static function (BeforeLoadContentEvent $event) use ($eventContent) { + $event->setContent($eventContent); + $event->stopPropagation(); + }, 10); + + $service = new ContentService($innerServiceMock, $traceableEventDispatcher); + $result = $service->loadContent(2, []); + + $calledListeners = $this->getListenersStack($traceableEventDispatcher->getCalledListeners()); + $notCalledListeners = $this->getListenersStack($traceableEventDispatcher->getNotCalledListeners()); + + $this->assertSame($eventContent, $result); + $this->assertSame($calledListeners, [ + [BeforeLoadContentEvent::class, 10], + ]); + $this->assertSame($notCalledListeners, [ + [BeforeLoadContentEvent::class, 0], + ]); + } } class_alias(ContentServiceTest::class, 'eZ\Publish\Core\Event\Tests\ContentServiceTest'); diff --git a/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php b/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php index 8d8a004560..26d74c4bf9 100644 --- a/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php +++ b/tests/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabaseTest.php @@ -287,9 +287,7 @@ public function testUpdateContent() { $gateway = $this->getDatabaseGateway(); - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $metadataStruct = $this->getMetadataUpdateStructFixture(); @@ -594,9 +592,7 @@ public function testUpdateNonTranslatableField() public function testListVersions(): void { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); $res = $gateway->listVersions(226); @@ -606,13 +602,6 @@ public function testListVersions(): void $res ); - foreach ($res as $row) { - $this->assertCount( - 23, - $row - ); - } - $this->assertEquals( 675, $res[0]['ezcontentobject_version_id'] @@ -637,9 +626,7 @@ public function testListVersionNumbers() public function testListVersionsForUser() { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); $res = $gateway->listVersionsForUser(14); @@ -649,13 +636,6 @@ public function testListVersionsForUser() $res ); - foreach ($res as $row) { - $this->assertCount( - 23, - $row - ); - } - $this->assertEquals( 677, $res[0]['ezcontentobject_version_id'] @@ -676,9 +656,7 @@ public function testListVersionsForUser() public function testLoadWithAllTranslations() { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); $res = $gateway->load(226, 2); @@ -698,9 +676,7 @@ public function testLoadWithAllTranslations() public function testCreateFixtureForMapperExtractContentFromRowsMultipleVersions() { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); @@ -721,9 +697,7 @@ public function testCreateFixtureForMapperExtractContentFromRowsMultipleVersions public function testCreateFixtureForMapperExtractContentFromRows() { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); @@ -741,9 +715,7 @@ public function testCreateFixtureForMapperExtractContentFromRows() public function testLoadWithSingleTranslation() { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); $res = $gateway->load(226, 2, [self::ENG_GB]); @@ -1434,9 +1406,7 @@ public function testDeleteRelationWithCompositeBitmask(): void */ public function testUpdateAlwaysAvailableFlagRemove(): void { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); $gateway->updateAlwaysAvailableFlag(103, false); @@ -1500,9 +1470,7 @@ public function testUpdateAlwaysAvailableFlagRemove(): void */ public function testUpdateAlwaysAvailableFlagAdd(): void { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); $contentId = 102; @@ -1570,9 +1538,7 @@ public function testUpdateAlwaysAvailableFlagAdd(): void */ public function testUpdateContentAddAlwaysAvailableFlagMultilingual(): void { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects_multilingual.php' - ); + $this->insertContentToDatabase('contentobjects_multilingual.php'); $gateway = $this->getDatabaseGateway(); $contentMetadataUpdateStruct = new MetadataUpdateStruct( @@ -1619,9 +1585,7 @@ public function testUpdateContentAddAlwaysAvailableFlagMultilingual(): void */ public function testUpdateContentRemoveAlwaysAvailableFlagMultilingual(): void { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects_multilingual.php' - ); + $this->insertContentToDatabase('contentobjects_multilingual.php'); $gateway = $this->getDatabaseGateway(); $contentMetadataUpdateStruct = new MetadataUpdateStruct( @@ -1667,9 +1631,7 @@ public function testUpdateContentRemoveAlwaysAvailableFlagMultilingual(): void */ public function testLoadVersionInfo(): void { - $this->insertDatabaseFixture( - __DIR__ . '/../_fixtures/contentobjects.php' - ); + $this->insertContentToDatabase(); $gateway = $this->getDatabaseGateway(); @@ -1989,6 +1951,17 @@ private function assertContentVersionAttributesLanguages( ->orderBy('id') ); } + + private function insertContentToDatabase(string $fileName = 'contentobjects.php'): void + { + $this->insertDatabaseFixture( + __DIR__ . '/../_fixtures/contentclass.php' + ); + + $this->insertDatabaseFixture( + __DIR__ . '/../_fixtures/' . $fileName + ); + } } class_alias(DoctrineDatabaseTest::class, 'eZ\Publish\Core\Persistence\Legacy\Tests\Content\Gateway\DoctrineDatabaseTest'); diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_cleanup_composite.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_cleanup_composite.php index f163a68873..9d405fabb9 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_cleanup_composite.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_cleanup_composite.php @@ -184,11 +184,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -223,4 +225,46 @@ 'content_translation' => 'eng-GB', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff.php index d465fe35e2..1831643fc9 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff.php @@ -184,11 +184,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -229,4 +231,46 @@ 'content_translation' => 'eng-GB', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff_simple.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff_simple.php index fc98ba8f8b..b271698024 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff_simple.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_diff_simple.php @@ -178,11 +178,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -211,4 +213,46 @@ 'content_translation' => 'eng-GB', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_path_identification_string.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_path_identification_string.php index 2034a1743c..5cc2c4c7ba 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_path_identification_string.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_path_identification_string.php @@ -137,11 +137,13 @@ 'id' => 2, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 3, 'initial_language_id' => 8, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -170,4 +172,46 @@ 'content_translation' => 'eng-GB', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_simple.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_simple.php index 6492f1e66c..551e82e7de 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_simple.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_multilang_simple.php @@ -172,11 +172,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -205,4 +207,46 @@ 'content_translation' => 'eng-GB', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_path_identification_string.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_path_identification_string.php index 488d2907ae..8187614763 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_path_identification_string.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_path_identification_string.php @@ -111,11 +111,13 @@ 'id' => 2, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -132,4 +134,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_external_history.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_external_history.php index 7b006ca6f9..8e16d2bbf0 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_external_history.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_external_history.php @@ -204,11 +204,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -225,4 +227,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_nop.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_nop.php index b73b2e0185..a40a2973b1 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_nop.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_reusing_nop.php @@ -172,11 +172,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -193,4 +195,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name.php index 3de9a6da9c..4c0fca9c5d 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name.php @@ -99,11 +99,13 @@ 'id' => 2, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -120,4 +122,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name_multilang.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name_multilang.php index 5e6862c3d8..03f6259041 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name_multilang.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_same_name_multilang.php @@ -131,11 +131,13 @@ 'id' => 2, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -164,4 +166,46 @@ 'content_translation' => 'eng-GB', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple.php index a8b350cf20..d0cdb52459 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple.php @@ -99,11 +99,13 @@ 'id' => 2, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -120,4 +122,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple_history.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple_history.php index 49e74d0807..c793b47fc1 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple_history.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_siblings_simple_history.php @@ -131,11 +131,13 @@ 'id' => 2, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -152,4 +154,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple.php index f1aaab3b69..c7f1427adc 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple.php @@ -140,11 +140,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -161,4 +163,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_conflict.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_conflict.php index 6079ac3ce0..ed0809372e 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_conflict.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_conflict.php @@ -198,11 +198,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -219,4 +221,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_history.php b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_history.php index 194ec2aaca..97945d1ec6 100644 --- a/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_history.php +++ b/tests/lib/Persistence/Legacy/Content/UrlAlias/_fixtures/urlaliases_swap_simple_history.php @@ -172,11 +172,13 @@ 'id' => 3, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 1, ], 1 => [ 'id' => 4, 'initial_language_id' => 2, 'current_version' => 1, + 'contentclass_id' => 2, ], ], 'ezcontentobject_name' => [ @@ -193,4 +195,46 @@ 'content_translation' => 'cro-HR', ], ], + 'ezcontentclass' => [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 2, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/_fixtures/contentclass.php b/tests/lib/Persistence/Legacy/Content/_fixtures/contentclass.php new file mode 100644 index 0000000000..7dc4005b62 --- /dev/null +++ b/tests/lib/Persistence/Legacy/Content/_fixtures/contentclass.php @@ -0,0 +1,410 @@ + [ + 0 => [ + 'id' => 1, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917596', + 'creator_id' => 14, + 'identifier' => 'folder', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154215', + 'modifier_id' => 14, + 'remote_id' => '5fcdb3fb687dd6dcf8c94bc84e8bd1b2', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 1 => [ + 'id' => 3, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'user_group', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154815', + 'modifier_id' => 14, + 'remote_id' => '0f2622aad22267e195c8e76b05c25e29', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 2 => [ + 'id' => 4, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => ' ', + 'created' => '1033918596', + 'creator_id' => 14, + 'identifier' => 'user', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311184215', + 'modifier_id' => 14, + 'remote_id' => '40cca73dac5cec06af9e2f3e1d79f296', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:4:"User";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 3 => [ + 'id' => 14, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '', + 'created' => '1033917896', + 'creator_id' => 14, + 'identifier' => 'file', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311158215', + 'modifier_id' => 14, + 'remote_id' => '808394adba21c655214c18aeab95fc27', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:2:{s:6:"eng-GB";s:4:"File";s:16:"always-available";s:6:"eng-GB";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 4 => [ + 'id' => 15, + 'version' => 1, + 'always_available' => 0, + 'contentobject_name' => null, + 'created' => '1033917996', + 'creator_id' => 14, + 'identifier' => 'landing_page', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154915', + 'modifier_id' => 14, + 'remote_id' => '3f0f42fe0d5ad444ffbc4fefe92a3f06', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:12:"Landing page";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 5 => [ + 'id' => 16, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033915596', + 'creator_id' => 14, + 'identifier' => 'article', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154255', + 'modifier_id' => 14, + 'remote_id' => 'af4e6d7bf4ed96fc77eb5839e8c2ceb8', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:7:"Article";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 6 => [ + 'id' => 18, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917536', + 'creator_id' => 14, + 'identifier' => 'tag', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '13111542635', + 'modifier_id' => 14, + 'remote_id' => '9f4373927b4f2d9109aa5b97dc3fbeb6', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:3:"Tag";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 7 => [ + 'id' => 20, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917556', + 'creator_id' => 14, + 'identifier' => 'product_category_tag', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154255', + 'modifier_id' => 14, + 'remote_id' => 'f64c05d15c81d9ed239c997c7ef7f088', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Folder";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 8 => [ + 'id' => 21, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917796', + 'creator_id' => 14, + 'identifier' => 'customer', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311154415', + 'modifier_id' => 14, + 'remote_id' => '14883b7cf325724dcb7cc279a0455a7b', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:8:"Customer";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 9 => [ + 'id' => 22, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '<name>', + 'created' => '1033917696', + 'creator_id' => 14, + 'identifier' => 'member', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311154225', + 'modifier_id' => 14, + 'remote_id' => 'e8b9d33d5fd346e3d2787fdf0a75ab1a', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:6:"Member";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 10 => [ + 'id' => 23, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917096', + 'creator_id' => 14, + 'identifier' => 'company', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311154015', + 'modifier_id' => 14, + 'remote_id' => 'd1bc6331c8df0a5efb4d24d8bd5862da', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:7:"Company";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 11 => [ + 'id' => 24, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917506', + 'creator_id' => 14, + 'identifier' => 'shipping_address', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154205', + 'modifier_id' => 14, + 'remote_id' => '4180aa6f06a49835fbb9e380a30d9fe5', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:16:"Shipping address";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 12 => [ + 'id' => 25, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917590', + 'creator_id' => 14, + 'identifier' => 'customer_portal', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154210', + 'modifier_id' => 14, + 'remote_id' => '7fb809789d8a799f24d1205c284555df', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:15:"Customer Portal";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 13 => [ + 'id' => 26, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '<name>', + 'created' => '1033917600', + 'creator_id' => 14, + 'identifier' => 'new_product_type', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154220', + 'modifier_id' => 14, + 'remote_id' => '826779f2aef696943a9e0c1d55bb881d', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:16:"New product type";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 14 => [ + 'id' => 30, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<tag_name>', + 'created' => '1033917599', + 'creator_id' => 14, + 'identifier' => 'new_tag', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154219', + 'modifier_id' => 14, + 'remote_id' => '5ea8fae70c53f76ca83b23cce8a5400a', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:7:"New Tag";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 15 => [ + 'id' => 35, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917598', + 'creator_id' => 14, + 'identifier' => 'old_tag', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311154218', + 'modifier_id' => 14, + 'remote_id' => '10820975ade1fe98bc93372c4263f0fb', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:7:"Old Tag";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 16 => [ + 'id' => 37, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917597', + 'creator_id' => 14, + 'identifier' => 'page', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154217', + 'modifier_id' => 14, + 'remote_id' => 'ac76f2a4caea8329c11126957941e2e0', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:4:"Page";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 17 => [ + 'id' => 38, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '<name>', + 'created' => '1033917591', + 'creator_id' => 14, + 'identifier' => 'lottery', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311154211', + 'modifier_id' => 14, + 'remote_id' => '0e9228de7bd25b334c138e2fb143db77', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:7:"Lottery";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 18 => [ + 'id' => 41, + 'version' => '0', + 'always_available' => 0, + 'contentobject_name' => '<name>', + 'created' => '1033917594', + 'creator_id' => 14, + 'identifier' => 'test', + 'initial_language_id' => 2, + 'is_container' => false, + 'language_mask' => 2, + 'modified' => '1311154213', + 'modifier_id' => 14, + 'remote_id' => '513ea82647fef3e8401a985d2743884b', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:4:"Test";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + 19 => [ + 'id' => 42, + 'version' => '0', + 'always_available' => 1, + 'contentobject_name' => '<name>', + 'created' => '1033917595', + 'creator_id' => 14, + 'identifier' => 'news', + 'initial_language_id' => 2, + 'is_container' => true, + 'language_mask' => 2, + 'modified' => '1311154214', + 'modifier_id' => 14, + 'remote_id' => 'faeb8e023bcba08bac3439732d49ab40', + 'serialized_description_list' => 'a:0:{}', + 'serialized_name_list' => 'a:1:{s:6:"eng-GB";s:4:"News";}', + 'sort_field' => 1, + 'sort_order' => 1, + 'url_alias_name' => null, + ], + ], +]; diff --git a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows.php b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows.php index 0e05b81b1d..af448438c6 100644 --- a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows.php +++ b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows.php @@ -38,6 +38,7 @@ 'ezcontentobject_attribute_sort_key_int' => 0, 'ezcontentobject_attribute_sort_key_string' => 'new test article (2)', 'ezcontentobject_tree_main_node_id' => 228, + 'content_type_identifier' => 'article', ], 1 => [ 'ezcontentobject_id' => 226, @@ -72,6 +73,7 @@ 'ezcontentobject_attribute_sort_key_string' => 'something', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 2 => [ 'ezcontentobject_id' => 226, @@ -108,6 +110,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 3 => [ 'ezcontentobject_id' => 226, @@ -142,6 +145,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 4 => [ 'ezcontentobject_id' => 226, @@ -178,6 +182,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 5 => [ 'ezcontentobject_id' => 226, @@ -212,6 +217,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 6 => [ 'ezcontentobject_id' => 226, @@ -246,6 +252,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 7 => [ 'ezcontentobject_id' => 226, @@ -280,6 +287,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], 8 => [ 'ezcontentobject_id' => 226, @@ -314,5 +322,6 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => 228, 'ezcontentobject_is_hidden' => 0, + 'content_type_identifier' => 'article', ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_multiple_versions.php b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_multiple_versions.php index 7acb59c8fc..182c89d56d 100644 --- a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_multiple_versions.php +++ b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_multiple_versions.php @@ -38,6 +38,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => '12', 'ezcontentobject_is_hidden' => '0', + 'content_type_identifier' => 'user_group', ], 1 => [ 'ezcontentobject_id' => '11', @@ -72,6 +73,7 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => '12', 'ezcontentobject_is_hidden' => '0', + 'content_type_identifier' => 'user_group', ], 2 => [ 'ezcontentobject_id' => '11', @@ -106,6 +108,7 @@ 'ezcontentobject_attribute_sort_key_string' => 'members', 'ezcontentobject_tree_main_node_id' => '12', 'ezcontentobject_is_hidden' => '0', + 'content_type_identifier' => 'user_group', ], 3 => [ 'ezcontentobject_id' => '11', @@ -140,5 +143,6 @@ 'ezcontentobject_attribute_sort_key_string' => '', 'ezcontentobject_tree_main_node_id' => '12', 'ezcontentobject_is_hidden' => '0', + 'content_type_identifier' => 'user_group', ], ]; diff --git a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_result.php b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_result.php index 03f9783faa..08588d1b01 100644 --- a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_result.php +++ b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_content_from_rows_result.php @@ -40,6 +40,7 @@ $versionInfo->contentInfo->name = 'Something'; $versionInfo->contentInfo->mainLocationId = 228; $versionInfo->contentInfo->status = 1; +$versionInfo->contentInfo->contentTypeIdentifier = 'article'; $content->versionInfo = $versionInfo; diff --git a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_version_info_from_rows_multiple_versions.php b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_version_info_from_rows_multiple_versions.php index bfe811f9ae..666acff70d 100644 --- a/tests/lib/Persistence/Legacy/Content/_fixtures/extract_version_info_from_rows_multiple_versions.php +++ b/tests/lib/Persistence/Legacy/Content/_fixtures/extract_version_info_from_rows_multiple_versions.php @@ -29,6 +29,7 @@ 'ezcontentobject_language_mask' => '3', 'ezcontentobject_is_hidden' => '0', 'ezcontentobject_version_contentobject_id' => '11', + 'content_type_identifier' => 'user_group', ], 1 => [ 'ezcontentobject_version_id' => '674', @@ -54,5 +55,6 @@ 'ezcontentobject_language_mask' => '3', 'ezcontentobject_is_hidden' => '0', 'ezcontentobject_version_contentobject_id' => '11', + 'content_type_identifier' => 'user_group', ], ]; diff --git a/tests/lib/Persistence/ValueObject/ContentInfoTest.php b/tests/lib/Persistence/ValueObject/ContentInfoTest.php new file mode 100644 index 0000000000..0d60506e73 --- /dev/null +++ b/tests/lib/Persistence/ValueObject/ContentInfoTest.php @@ -0,0 +1,23 @@ +<?php + +/** + * @copyright Copyright (C) Ibexa AS. All rights reserved. + * @license For full copyright and license information view LICENSE file distributed with this source code. + */ +declare(strict_types=1); + +namespace Ibexa\Tests\Core\Persistence\ValueObject; + +use Ibexa\Contracts\Core\Persistence\Content\ContentInfo; +use Ibexa\Tests\Core\Persistence\Legacy\TestCase; + +final class ContentInfoTest extends TestCase +{ + public function testGetContentTypeIdentifier(): void + { + $contentTypeIdentifier = 'foo'; + $contentInfo = new ContentInfo(['contentTypeIdentifier' => $contentTypeIdentifier]); + + self::assertSame($contentTypeIdentifier, $contentInfo->getContentTypeIdentifier()); + } +}