From a2e723615b6110e71e4a64e862c97d6541524f73 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Tue, 1 Aug 2023 00:48:52 +0200 Subject: [PATCH] [TASK] Fix MM TCA of blog_example Extension blog_example is used in various extbase tests. It defines invalid relations from tags table over MM to post and persons. The patch fixes the TCA - those relations now work in BE as well, when the fixture blog_example is activated. Essentially all functional tests that works with this extension break with the fixed TCA now. The major part of the patch is to disentangle the .csv import and export files to make them independent from each other per test-case, and to fix the imported and asserted db state along the way. Resolves: #101528 Releases: main, 12.4 Change-Id: I4fb7d6ac82962f8ef7b630b261d543f4ff626bde Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80295 Reviewed-by: Christian Kuhn Tested-by: core-ci Tested-by: Christian Kuhn --- .../tx_blogexample_domain_model_person.php | 22 +- .../TCA/tx_blogexample_domain_model_post.php | 14 +- .../TCA/tx_blogexample_domain_model_tag.php | 31 +- .../Private/Language/locallang_db.xlf | 4 +- .../Extensions/blog_example/ext_tables.sql | 35 +- .../Tests/Functional/Fixtures/pages.csv | 9 - .../ControllerArgumentsMappingTest.php | 2 +- .../ControllerArgumentsMappingTestImport.csv | 8 + .../ActionControllerValidationTest.php | 18 +- .../ActionControllerValidationTestImport.csv | 43 ++ .../QueryResultPaginatorTestImport.csv} | 0 .../Pagination/QueryResultPaginatorTest.php | 2 +- .../Tests/Functional/Persistence/AddTest.php | 16 +- .../Functional/Persistence/CountTest.php | 53 +- .../Persistence/EnableFieldsTest.php | 16 +- .../Persistence/Fixtures/CountTestImport.csv | 87 +++ .../Fixtures/DataSet/LiveDefaultElements.csv | 83 +++ .../Fixtures/DataSet/LiveDefaultPages.csv | 7 + ..._groups.csv => EnableFieldsTestImport.csv} | 17 +- .../Persistence/Fixtures/InTestImport.csv | 30 + .../Fixtures/IsDirtyTestImport.csv | 21 + .../Fixtures/LazyLoadingProxyTestImport.csv | 3 + .../Fixtures/LazyObjectStorageTestImport.csv | 15 + .../Fixtures/OperatorTestImport.csv | 19 + .../Fixtures/QueryLocalizedDataTestImport.csv | 73 +++ .../Fixtures/QueryParserTestImport.csv | 81 +++ .../Fixtures/RelationTestImport.csv | 87 +++ ...tionTestResultAddPostToBlogInTheMiddle.csv | 88 +++ ...ationTestResultAddTagToPostInTheMiddle.csv | 89 +++ ...tionTestResultAttachPostToBlogAtTheEnd.csv | 88 +++ ...ationTestResultAttachTagToPostAtTheEnd.csv | 89 +++ ...onTestResultMovePostFromEndToTheMiddle.csv | 87 +++ ...ionTestResultMoveTagFromEndToTheMiddle.csv | 87 +++ ...lationTestResultRemoveLastPostFromBlog.csv | 87 +++ ...elationTestResultRemoveLastTagFromPost.csv | 86 +++ ...tionTestResultRemoveMiddlePostFromBlog.csv | 87 +++ ...ationTestResultRemoveMiddleTagFromPost.csv | 86 +++ .../Fixtures/RepositoryTestImport.csv | 26 + .../Fixtures/TranslationTestImport.csv | 31 + .../Fixtures/WorkspaceTestImport.csv | 59 ++ .../Persistence/Fixtures/categories.csv | 7 - .../Persistence/Fixtures/category-mm.csv | 15 - .../Persistence/Fixtures/comments.csv | 7 - .../Persistence/Fixtures/fe_groups.csv | 4 - .../Persistence/Fixtures/fe_users.csv | 14 - .../Persistence/Fixtures/persons.csv | 6 - .../Persistence/Fixtures/post-post-mm.csv | 3 - .../Persistence/Fixtures/post-tag-mm.csv | 24 - .../Persistence/Fixtures/tags-mm.csv | 9 - .../Functional/Persistence/Fixtures/tags.csv | 16 - .../Persistence/Fixtures/translated-posts.csv | 12 - .../Fixtures/translatedBlogExampleData.csv | 73 --- .../Generic/Mapper/DataMapperTest.php | 6 +- .../Mapper/Fixtures/DataMapperTestImport.csv | 31 + .../Mapper/Fixtures/administrators.csv | 3 - .../Fixtures/Typo3DbBackendTestImport.csv} | 18 +- .../Generic/Storage/Typo3DbBackendTest.php | 6 +- .../Tests/Functional/Persistence/InTest.php | 64 +- .../Functional/Persistence/IsDirtyTest.php | 54 +- .../Persistence/LazyLoadingProxyTest.php | 16 +- .../Persistence/LazyObjectStorageTest.php | 13 +- .../Functional/Persistence/OperatorTest.php | 31 +- .../Persistence/QueryLocalizedDataTest.php | 18 +- .../Persistence/QueryParserTest.php | 69 +- .../Functional/Persistence/RelationTest.php | 598 +----------------- .../Functional/Persistence/RepositoryTest.php | 51 +- .../Persistence/TranslatedSiteContentTest.php | 10 +- .../Persistence/TranslationTest.php | 146 +---- .../Functional/Persistence/WorkspaceTest.php | 139 ++-- 69 files changed, 1885 insertions(+), 1364 deletions(-) delete mode 100644 typo3/sysext/extbase/Tests/Functional/Fixtures/pages.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/ControllerArgumentsMappingTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Mvc/Validation/Fixtures/ActionControllerValidationTestImport.csv rename typo3/sysext/extbase/Tests/Functional/{Persistence/Fixtures/posts.csv => Pagination/Fixtures/QueryResultPaginatorTestImport.csv} (100%) create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/CountTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultElements.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultPages.csv rename typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/{blogs-with-fe_groups.csv => EnableFieldsTestImport.csv} (50%) create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/InTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/IsDirtyTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyLoadingProxyTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyObjectStorageTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/OperatorTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryLocalizedDataTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryParserTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddPostToBlogInTheMiddle.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddTagToPostInTheMiddle.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachPostToBlogAtTheEnd.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachTagToPostAtTheEnd.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMovePostFromEndToTheMiddle.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMoveTagFromEndToTheMiddle.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastPostFromBlog.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastTagFromPost.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddlePostFromBlog.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddleTagFromPost.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RepositoryTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/TranslationTestImport.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/WorkspaceTestImport.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/categories.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/category-mm.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/comments.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/persons.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-post-mm.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-tag-mm.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags-mm.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translatedBlogExampleData.csv create mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/DataMapperTestImport.csv delete mode 100644 typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/administrators.csv rename typo3/sysext/extbase/Tests/Functional/Persistence/{Fixtures/blogs.csv => Generic/Storage/Fixtures/Typo3DbBackendTestImport.csv} (73%) diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_person.php b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_person.php index b5493a48b985..a9dec75a73da 100644 --- a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_person.php +++ b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_person.php @@ -83,36 +83,30 @@ 'tags' => [ 'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xlf:tx_blogexample_domain_model_person.tags', 'config' => [ - 'type' => 'inline', + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'tx_blogexample_domain_model_tag', 'MM' => 'tx_blogexample_domain_model_tag_mm', 'MM_match_fields' => [ 'fieldname' => 'tags', + 'tablenames' => 'tx_blogexample_domain_model_person', ], - 'appearance' => [ - 'useCombination' => 1, - 'useSortable' => 1, - 'collapseAll' => 1, - 'expandSingle' => 1, - ], + 'MM_opposite_field' => 'items', ], ], 'tags_special' => [ 'exclude' => true, 'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xlf:tx_blogexample_domain_model_person.tags_special', 'config' => [ - 'type' => 'inline', + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'tx_blogexample_domain_model_tag', 'MM' => 'tx_blogexample_domain_model_tag_mm', 'MM_match_fields' => [ 'fieldname' => 'tags_special', + 'tablenames' => 'tx_blogexample_domain_model_person', ], - 'appearance' => [ - 'useCombination' => 1, - 'useSortable' => 1, - 'collapseAll' => 1, - 'expandSingle' => 1, - ], + 'MM_opposite_field' => 'items', ], ], ], diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_post.php b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_post.php index faabf2064b80..49d2e758a18e 100644 --- a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_post.php +++ b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_post.php @@ -178,15 +178,15 @@ 'exclude' => true, 'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xlf:tx_blogexample_domain_model_post.tags', 'config' => [ - 'type' => 'inline', + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'tx_blogexample_domain_model_tag', - 'MM' => 'tx_blogexample_post_tag_mm', - 'appearance' => [ - 'useCombination' => 1, - 'useSortable' => 1, - 'collapseAll' => 1, - 'expandSingle' => 1, + 'MM' => 'tx_blogexample_domain_model_tag_mm', + 'MM_match_fields' => [ + 'fieldname' => 'tags', + 'tablenames' => 'tx_blogexample_domain_model_post', ], + 'MM_opposite_field' => 'items', ], ], 'comments' => [ diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_tag.php b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_tag.php index d70f537eed7a..642e6f0de858 100644 --- a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_tag.php +++ b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_tag.php @@ -63,29 +63,28 @@ 'max' => 256, ], ], - 'posts' => [ + 'items' => [ 'exclude' => true, - 'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xlf:tx_blogexample_domain_model_tag.posts', + 'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xlf:tx_blogexample_domain_model_tag.items', 'config' => [ - 'type' => 'select', - 'renderType' => 'selectMultipleSideBySide', + 'type' => 'group', + 'allowed' => 'tx_blogexample_domain_model_person,tx_blogexample_domain_model_post', 'size' => 10, - 'autoSizeMax' => 30, - 'multiple' => 0, - 'foreign_table' => 'tx_blogexample_domain_model_post', - 'MM' => 'tx_blogexample_post_tag_mm', - // @todo: Broken. tx_blogexample_post_tag should be the local side, not the foreign side, - // since it is used from both _post and _person table. This field should drop - // MM_opposite_field and add MM_oppositeUsage instead, similar to sys_category items. - // The counterparts in _post and _person table need adaptions, too. - // It also does not make much sense to call this field 'posts' in the first place, - // since it is used from _person, too. - 'MM_opposite_field' => 'tags', + 'MM' => 'tx_blogexample_domain_model_tag_mm', + 'MM_oppositeUsage' => [ + 'tx_blogexample_domain_model_person' => [ + 'tags', + 'tags_special', + ], + 'tx_blogexample_domain_model_post' => [ + 'tags', + ], + ], ], ], ], 'types' => [ - '1' => ['showitem' => 'sys_language_uid, hidden, name, posts'], + '1' => ['showitem' => 'sys_language_uid, hidden, name, items'], ], 'palettes' => [ '1' => ['showitem' => ''], diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xlf b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xlf index fafc9b0ebddb..39e9964776ad 100644 --- a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xlf +++ b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xlf @@ -117,8 +117,8 @@ Name - - Related posts + + Related items Additional Info diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.sql b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.sql index ce3ec7d260d6..aff9fd0019ef 100644 --- a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.sql +++ b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.sql @@ -5,7 +5,7 @@ CREATE TABLE tx_blogexample_domain_model_blog ( title varchar(255) DEFAULT '' NOT NULL, subtitle varchar(255) DEFAULT '', description text NOT NULL, - logo tinyblob NOT NULL, + logo tinyblob NOT NULL default '', administrator int(11) DEFAULT '0' NOT NULL, posts varchar(255) DEFAULT '' NOT NULL @@ -48,6 +48,7 @@ CREATE TABLE tx_blogexample_domain_model_person ( firstname varchar(255) DEFAULT '' NOT NULL, lastname varchar(255) DEFAULT '' NOT NULL, email varchar(255) DEFAULT '' NOT NULL, + salutation varchar(4) DEFAULT '' NOT NULL, tags int(11) unsigned DEFAULT '0' NOT NULL, tags_special int(11) unsigned DEFAULT '0' NOT NULL ); @@ -57,37 +58,7 @@ CREATE TABLE tx_blogexample_domain_model_person ( # CREATE TABLE tx_blogexample_domain_model_tag ( name varchar(255) DEFAULT '' NOT NULL, - posts int(11) unsigned DEFAULT '0' NOT NULL -); - -# -# Table structure for table 'tx_blogexample_domain_model_tag_mm' -# @todo: Should be dropped when TCA is fixed. -# -CREATE TABLE tx_blogexample_domain_model_tag_mm ( - uid_local int(11) unsigned DEFAULT '0' NOT NULL, - uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, - tablenames varchar(255) DEFAULT '' NOT NULL, - fieldname varchar(255) DEFAULT '' NOT NULL, - sorting int(11) unsigned DEFAULT '0' NOT NULL, - sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, - - KEY uid_local (uid_local), - KEY uid_foreign (uid_foreign) -); - -# -# Table structure for table 'tx_blogexample_post_tag_mm' -# @todo: Should be dropped when TCA is fixed. -# -CREATE TABLE tx_blogexample_post_tag_mm ( - uid_local int(11) unsigned DEFAULT '0' NOT NULL, - uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, - sorting int(11) unsigned DEFAULT '0' NOT NULL, - sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, - - KEY uid_local (uid_local), - KEY uid_foreign (uid_foreign) + items int(11) unsigned DEFAULT '0' NOT NULL ); # diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/pages.csv b/typo3/sysext/extbase/Tests/Functional/Fixtures/pages.csv deleted file mode 100644 index 1fcb4b24df5a..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Fixtures/pages.csv +++ /dev/null @@ -1,9 +0,0 @@ -"pages" -,"uid","pid","sorting","title","deleted","perms_everybody" -,1,0,128,"Root",0,15 -,2,1,128,"Dummy 1-2",0,15 -,3,2,128,"Dummy 1-2-3",0,15 -,4,3,128,"Dummy 1-2-3-4",0,15 -,5,1,256,"Dummy 1-5",0,15 -,6,5,128,"Dummy 1-5-6",0,15 -,7,0,256,"Root 2",0,15 diff --git a/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ControllerArgumentsMappingTest.php b/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ControllerArgumentsMappingTest.php index 4d4bfebea7db..c26e91fe1fda 100644 --- a/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ControllerArgumentsMappingTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ControllerArgumentsMappingTest.php @@ -52,7 +52,7 @@ protected function setUp(): void { parent::setUp(); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/translatedBlogExampleData.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixture/ControllerArgumentsMappingTestImport.csv'); $configuration = [ 'persistence' => [ diff --git a/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/ControllerArgumentsMappingTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/ControllerArgumentsMappingTestImport.csv new file mode 100644 index 000000000000..41416f2c9af6 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Mvc/Controller/Fixture/ControllerArgumentsMappingTestImport.csv @@ -0,0 +1,8 @@ +"pages" +,"uid","pid","sorting","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title" +,1,0,256,0,0,0,0,0,0,"FunctionalTest" +,20,1,256,0,0,0,0,0,0,"Blog example test" +"tx_blogexample_domain_model_blog" +,"uid","pid","title","sys_language_uid","l18n_parent","administrator","subtitle","description","t3_origuid","deleted","hidden","posts","logo" +,1,20,"Blog 1",0,0,0,,,0,0,0,10, +,2,20,"Blog 1 DK",1,1,0,,,1,0,0,6, diff --git a/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php b/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php index 1ce78e28c0df..c04992a604ad 100644 --- a/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.php @@ -41,6 +41,12 @@ final class ActionControllerValidationTest extends FunctionalTestCase 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', ]; + public function setUp(): void + { + parent::setUp(); + $this->importCSVDataSet(__DIR__ . '/Fixtures/ActionControllerValidationTestImport.csv'); + } + public static function forwardedActionValidatesPreviouslyIgnoredArgumentDataProvider(): array { return [ @@ -66,10 +72,6 @@ public function forwardedActionValidatesPreviouslyIgnoredArgument(array $blogPos $GLOBALS['LANG'] = $this->get(LanguageServiceFactory::class)->create('default'); $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 'testkey'; - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/posts.csv'); - $response = new Response(); $serverRequest = (new ServerRequest())->withAttribute('extbase', new ExtbaseRequestParameters())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $serverRequest; @@ -119,10 +121,6 @@ public function validationResultsAreProvidedForTheSameObjectInDifferentArguments $GLOBALS['LANG'] = $this->get(LanguageServiceFactory::class)->create('default'); $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 'testkey'; - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/posts.csv'); - $response = new Response(); $serverRequest = (new ServerRequest())->withAttribute('extbase', new ExtbaseRequestParameters())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $serverRequest; @@ -186,10 +184,6 @@ public function argumentsOfOriginalRequestRemainOnValidationErrors(): void $GLOBALS['LANG'] = $this->get(LanguageServiceFactory::class)->create('default'); $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 'testkey'; - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../../Persistence/Fixtures/posts.csv'); - $response = new Response(); $serverRequest = (new ServerRequest())->withAttribute('extbase', new ExtbaseRequestParameters()) ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); diff --git a/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/Fixtures/ActionControllerValidationTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/Fixtures/ActionControllerValidationTestImport.csv new file mode 100644 index 000000000000..9bd8d6f6eccb --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Mvc/Validation/Fixtures/ActionControllerValidationTestImport.csv @@ -0,0 +1,43 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +,2,1,128,"Dummy 1-2",0,15 +,3,2,128,"Dummy 1-2-3",0,15 +,4,3,128,"Dummy 1-2-3-4",0,15 +,5,1,256,"Dummy 1-5",0,15 +,6,5,128,"Dummy 1-5-6",0,15 +,7,0,256,"Root 2",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,,0,1,3,0,0,0,0,0 +,4,0,Blog4Hidden,"Blog4 Description",,,0,1,0,0,0,0,0,1 +,5,0,Blog5Deleted,"Blog5 Description",,,1,1,3,0,0,0,0,0 +,6,0,Blog6Hidden,"Blog6 Description",,,0,1,0,0,0,0,0,1 +,7,0,BlogNoPosts,"Blog with w/o posts",,,0,0,0,0,0,0,0,0 +,101,0,"WorkspaceOverlay Blog1","WorkspaceOverlay Blog1 Description",,,0,10,0,2,1,0,1,0 +,102,0,"WorkspaceOverlay Blog6Enabled","WorkspaceOverlay Blog6 Description",,,0,1,0,1,6,0,1,0 +,103,0,"WorkspaceOverlay Blog2HiddenInWorkspace","WorkspaceOverlay Blog2HiddenInWorkspace Description",,,0,1,0,0,2,0,1,1 +,104,0,"WorkspaceOverlay Blog4HiddenInLiveAndWorkspace","WorkspaceOverlay Blog4HiddenInLiveAndWorkspace Description",,,0,1,0,0,4,0,1,1 +tx_blogexample_domain_model_post +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,l18n_diffsource,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",,1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",,2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",,3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",,4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",,5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",,6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",,7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",,8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",,9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",,10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",,11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",,1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",,11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",,11,1,0,0,0,0,0 +,101,0,121319,1,3,2,10,1502275450,3,"WorkspaceOverlay Post1","WorkspaceOverlay Lorem ipsum...",,1,0,0,1,1,0,1 +,102,0,0,1,2,2,1,1502275450,0,"WorkspaceOverlay Post2","WorkspaceOverlay Lorem ipsum...",,2,0,0,0,2,0,1 +,103,0,0,1,2,1,1,1502275450,0,"WorkspaceOverlay Post3","WorkspaceOverlay Lorem ipsum...",,3,0,0,0,3,0,1 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/posts.csv b/typo3/sysext/extbase/Tests/Functional/Pagination/Fixtures/QueryResultPaginatorTestImport.csv similarity index 100% rename from typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/posts.csv rename to typo3/sysext/extbase/Tests/Functional/Pagination/Fixtures/QueryResultPaginatorTestImport.csv diff --git a/typo3/sysext/extbase/Tests/Functional/Pagination/QueryResultPaginatorTest.php b/typo3/sysext/extbase/Tests/Functional/Pagination/QueryResultPaginatorTest.php index ff922e23e7d6..d0a2be568def 100644 --- a/typo3/sysext/extbase/Tests/Functional/Pagination/QueryResultPaginatorTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Pagination/QueryResultPaginatorTest.php @@ -35,7 +35,7 @@ final class QueryResultPaginatorTest extends FunctionalTestCase protected function setUp(): void { parent::setUp(); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/QueryResultPaginatorTestImport.csv'); $this->postRepository = $this->get(PostRepository::class); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/AddTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/AddTest.php index 6d5732f3aa6e..03735c73855f 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/AddTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/AddTest.php @@ -29,7 +29,9 @@ final class AddTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected PersistenceManager $persistentManager; protected BlogRepository $blogRepository; @@ -59,8 +61,7 @@ public function addSimpleObjectTest(): void $this->persistentManager->persistAll(); $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_blog'); - $queryBuilder->getRestrictions() - ->removeAll(); + $queryBuilder->getRestrictions()->removeAll(); $newBlogCount = $queryBuilder ->count('*') ->from('tx_blogexample_domain_model_blog') @@ -88,8 +89,7 @@ public function addObjectSetsDefaultLanguageTest(): void $this->persistentManager->persistAll(); $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_blog'); - $queryBuilder->getRestrictions() - ->removeAll(); + $queryBuilder->getRestrictions()->removeAll(); $newBlogRecord = $queryBuilder ->select('*') ->from('tx_blogexample_domain_model_blog') @@ -118,8 +118,7 @@ public function addObjectSetsDefinedLanguageTest(): void $this->persistentManager->persistAll(); $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_blog'); - $queryBuilder->getRestrictions() - ->removeAll(); + $queryBuilder->getRestrictions()->removeAll(); $newBlogRecord = $queryBuilder ->select('*') ->from('tx_blogexample_domain_model_blog') @@ -154,8 +153,7 @@ public function addObjectSetsNullAsNullForSimpleTypes(): void $this->persistentManager->persistAll(); $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_blog'); - $queryBuilder->getRestrictions() - ->removeAll(); + $queryBuilder->getRestrictions()->removeAll(); $newBlogRecord = $queryBuilder ->select('*') ->from('tx_blogexample_domain_model_blog') diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/CountTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/CountTest.php index 93d08d82f100..8e54472e1d50 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/CountTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/CountTest.php @@ -25,29 +25,19 @@ final class CountTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; /** * @var int number of all records */ protected int $numberOfRecordsInFixture = 14; - protected PostRepository $postRepository; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-post-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/persons.csv'); - - $this->postRepository = $this->get(PostRepository::class); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/CountTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -57,7 +47,7 @@ protected function setUp(): void */ public function simpleCountTest(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); self::assertSame($this->numberOfRecordsInFixture, $query->count()); } @@ -66,11 +56,9 @@ public function simpleCountTest(): void */ public function offsetCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->setLimit($this->numberOfRecordsInFixture+1); $query->setOffset(6); - self::assertSame($this->numberOfRecordsInFixture - 6, $query->count()); } @@ -79,11 +67,9 @@ public function offsetCountTest(): void */ public function exceedingOffsetCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->setLimit($this->numberOfRecordsInFixture+1); $query->setOffset($this->numberOfRecordsInFixture + 5); - self::assertSame(0, $query->count()); } @@ -92,10 +78,8 @@ public function exceedingOffsetCountTest(): void */ public function limitCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->setLimit(4); - self::assertSame(4, $query->count()); } @@ -104,12 +88,10 @@ public function limitCountTest(): void */ public function limitAndOffsetCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query ->setOffset($this->numberOfRecordsInFixture - 3) ->setLimit(4); - self::assertSame(3, $query->count()); } @@ -118,12 +100,10 @@ public function limitAndOffsetCountTest(): void */ public function inConstraintCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->in('uid', [1, 2, 3]) ); - self::assertSame(3, $query->count()); } @@ -134,12 +114,10 @@ public function inConstraintCountTest(): void */ public function subpropertyJoinCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->equals('blog.title', 'Blog1') ); - self::assertSame(10, $query->count()); } @@ -150,12 +128,10 @@ public function subpropertyJoinCountTest(): void */ public function subpropertyJoinSameTableCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->equals('relatedPosts.title', 'Post2') ); - self::assertSame(1, $query->count()); } @@ -166,19 +142,16 @@ public function subpropertyJoinSameTableCountTest(): void */ public function subpropertyInMultipleLeftJoinCountTest(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->logicalOr( $query->equals('tags.uid', 1), $query->equals('tags.uid', 2) ) ); - // QueryResult is lazy, so we have to run valid method to initialize $result = $query->execute(); $result->valid(); - self::assertSame(10, $result->count()); } diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php index ed99112568a3..162a2ea063d7 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php @@ -26,19 +26,19 @@ final class EnableFieldsTest extends AbstractDataHandlerActionTestCase { public const TABLE_Blog = 'tx_blogexample_domain_model_blog'; - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/fe_groups.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/fe_users.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs-with-fe_groups.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/EnableFieldsTestImport.csv'); $this->setUpFrontendSite(1); - $this->setUpFrontendRootPage(1, ['typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/JsonRenderer.typoscript']); + $this->setUpFrontendRootPage( + 1, + ['typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/JsonRenderer.typoscript'] + ); } /** diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/CountTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/CountTestImport.csv new file mode 100644 index 000000000000..558caf365708 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/CountTestImport.csv @@ -0,0 +1,87 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,,0,1,3,0,0,0,0,0 +,4,0,Blog4Hidden,"Blog4 Description",,,0,1,0,0,0,0,0,1 +,5,0,Blog5Deleted,"Blog5 Description",,,1,1,3,0,0,0,0,0 +,6,0,Blog6Hidden,"Blog6 Description",,,0,1,0,0,0,0,0,1 +,7,0,BlogNoPosts,"Blog with w/o posts",,,0,0,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,l18n_diffsource,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",,1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",,2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",,3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",,4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",,5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",,6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",,7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",,8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",,9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",,10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",,11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",,1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",,11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",,11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_post_post_mm +,uid_local,uid_foreign,sorting,sorting_foreign +,2,1,1,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,11,1,tx_blogexample_domain_model_person,tags,1,1 +,13,11,tx_blogexample_domain_model_person,tags_special,2,1 +,11,2,tx_blogexample_domain_model_person,tags,1,2 +,13,2,tx_blogexample_domain_model_person,tags_special,1,2 +,13,3,tx_blogexample_domain_model_person,tags_special,1,2 +,13,4,tx_blogexample_domain_model_person,tags_special,1,3 +,14,1,tx_blogexample_domain_model_person,tags,3,1 +,14,1,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,2,1 +,3,1,tx_blogexample_domain_model_post,tags,3,1 +,4,1,tx_blogexample_domain_model_post,tags,4,1 +,5,1,tx_blogexample_domain_model_post,tags,5,1 +,6,1,tx_blogexample_domain_model_post,tags,6,1 +,7,1,tx_blogexample_domain_model_post,tags,7,1 +,8,1,tx_blogexample_domain_model_post,tags,8,1 +,9,1,tx_blogexample_domain_model_post,tags,9,1 +,10,1,tx_blogexample_domain_model_post,tags,10,1 +,1,2,tx_blogexample_domain_model_post,tags,1,2 +,11,2,tx_blogexample_domain_model_post,tags,2,1 +,1,3,tx_blogexample_domain_model_post,tags,1,3 +,1,4,tx_blogexample_domain_model_post,tags,1,4 +,1,5,tx_blogexample_domain_model_post,tags,1,5 +,1,6,tx_blogexample_domain_model_post,tags,1,6 +,1,7,tx_blogexample_domain_model_post,tags,1,7 +,1,8,tx_blogexample_domain_model_post,tags,1,8 +,1,9,tx_blogexample_domain_model_post,tags,1,9 +,1,10,tx_blogexample_domain_model_post,tags,1,10 +,12,12,tx_blogexample_domain_model_post,tags,1,10 +,12,13,tx_blogexample_domain_model_post,tags,1,10 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultElements.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultElements.csv new file mode 100644 index 000000000000..473ba480380c --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultElements.csv @@ -0,0 +1,83 @@ +"tt_content",,,,,,,,,,,,,,,,,,,, +,"uid","pid","header","image","sorting","deleted","hidden","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","categories",,,, +,297,89,"Regular Element #1",1,256,0,0,0,0,0,0,0,0,0,0,2,,,, +,298,89,"Regular Element #2",1,512,0,0,0,0,0,0,0,0,0,0,0,,,, +,299,89,"Regular Element #3",1,768,0,0,0,0,0,0,0,0,0,0,0,,,, +,300,89,"[Translate to Dansk:] Regular Element #3",2,1024,0,0,1,299,299,299,0,0,0,0,0,,,, +,301,89,"[Translate to Dansk:] Regular Element #1",0,384,0,0,1,297,297,297,0,0,0,0,2,,,, +,302,89,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1",1,448,0,0,2,297,301,301,0,0,0,0,0,,,, +,303,89,"[DK] Without default language",1,1250,0,0,1,0,0,0,0,0,0,0,0,,,, +,304,89,"[DE] Without default language",0,1250,0,0,2,0,0,0,0,0,0,0,0,,,, +,305,89,"[Translate to Polski:] Regular Element #1",0,512,0,0,3,297,297,297,0,0,0,0,0,,,, +,306,89,"[PL] Without default language",0,1024,0,0,3,0,0,0,0,0,0,0,0,,,, +,307,89,"Hidden Element #4",0,128,0,1,0,0,0,0,0,0,0,0,0,,,, +,308,89,"[DK] UnHidden Element #4",0,128,0,0,1,307,307,307,0,0,0,0,0,,,, +,309,89,"[PL] Hidden Regular Element #2",0,512,0,1,3,298,298,298,0,0,0,0,0,,,, +"sys_file",,,,,,,,,,,,,,,,,,,, +,"uid","pid","type","storage","identifier","extension","mime_type","name","sha1","size","creation_date","modification_date","missing","metadata","identifier_hash","folder_hash","last_indexed",,, +,1,0,2,1,"/user_upload/kasper-skarhoj1.jpg","jpg","image/jpeg","kasper-skarhoj1.jpg","05d8c6dda534a0b9e7023c3031e60e4b49c3da40",39037,1375080761,1374139442,0,0,"a58963e60a4fcc31d1a869184a2d5d929dd27c8a","19669f1e02c2f16705ec7587044c66443be70725",0,,, +,21,0,2,1,"/user_upload/team-t3board10.jpg","jpg","image/jpeg","team-t3board10.jpg","ae6951147687ed1f94f60973fca7ef46e2ba2372",166843,1375080761,1374139442,0,0,"16ba2a587da8ef10dfccbe8b9841bde85afbd2d4","19669f1e02c2f16705ec7587044c66443be70725",0,,, +,20,0,2,1,"/user_upload/typo3-logo.png","png","image/png","typo3-logo.png","cdac36562aaa65d23831b25c48cd14863b5be2ad",1392,1449871035,1449871035,0,0,"ef4e3ead8d320c927228e158d950ade4a105081d","19669f1e02c2f16705ec7587044c66443be70725",0,,, +,,,,,,,,,,,,,,,,,,,, +"sys_file_metadata",,,,,,,,,,,,,,,,,,,, +,"uid","pid","sys_language_uid","l10n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","file","title","width","height","description","alternative","categories","l10n_diffsource",,, +,1,0,0,0,0,0,0,0,0,1,"Image Kasper",401,600,,,0,,,, +,21,0,0,0,0,0,0,0,0,21,"Image T3BOARD",1024,683,,,0,,,, +"sys_file_reference",,,,,,,,,,,,,,,,,,,, +,"uid","pid","title","uid_local","uid_foreign","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","deleted","tablenames","fieldname","sorting_foreign","description","alternative","link","l10n_diffsource" +,126,89,"T3BOARD",1,297,0,0,0,0,0,0,0,"tt_content","image",2,,,, +,127,89,"Kasper",21,299,0,0,0,0,0,0,0,"tt_content","image",1,,,, +,128,89,"[Kasper] Image translated to Dansk",21,300,1,127,0,0,0,0,0,"tt_content","image",1,,,, +,129,89,"[T3BOARD] Image added in Dansk (without parent)",1,300,1,0,0,0,0,0,0,"tt_content","image",2,,,, +,130,89,"[T3BOARD] Image added to DK element without default language",1,303,1,0,0,0,0,0,0,"tt_content","image",1,,,, +,131,89,"[T3BOARD] image translated to DE from DK",1,302,2,0,0,0,0,0,0,"tt_content","image",1,,,, +,132,89,"Kasper2",1,298,0,0,0,0,0,0,0,"tt_content","image",1,,,, +"sys_category",,,,,,,,,,,,,,,,,,,, +,"uid","pid","title","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","deleted",,,,,,,,,, +,1,89,"Category 1",0,0,0,0,0,0,0,,,,,,,,,, +,2,89,"[Translate to Dansk:] Category 1",1,1,0,0,0,0,0,,,,,,,,,, +,3,89,"Category 3 - not translated",0,0,0,0,0,0,0,,,,,,,,,, +,4,89,"Category 4",0,0,0,0,0,0,0,,,,,,,,,, +"sys_category_record_mm",,,,,,,,,,,,,,,,,,,, +,"uid_local","uid_foreign","tablenames","fieldname","sorting","sorting_foreign",,,,,,,,,,,,,, +,1,297,"tt_content","categories",0,1,,,,,,,,,,,,,, +,3,297,"tt_content","categories",0,1,,,,,,,,,,,,,, +,1,301,"tt_content","categories",0,1,,,,,,,,,,,,,, +,4,301,"tt_content","categories",0,1,,,,,,,,,,,,,, +"sys_refindex",,,,,,,,,,,,,,,,,,,, +,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,,,, +,"04650b476b686bf7b8fabdf7f7642991","sys_category",4,"items",,,,0,0,"tt_content",301,,,,,,,,, +,"0ad00e77a175a4a5d134cc2b115839fd","sys_file",20,"storage",,,,0,0,"sys_file_storage",1,,,,,,,,, +,"0d94a787208533a22dc514568c32ff6d","sys_category",1,"items",,,,1,0,"tt_content",301,,,,,,,,, +,"1130084e4038e95f2d5806b731cd416a","tt_content",300,"l18n_parent",,,,0,0,"tt_content",299,,,,,,,,, +,"12c2c72b6222bd07cb817a2d7db4c72b","tt_content",308,"l18n_parent",,,,0,0,"tt_content",307,,,,,,,,, +,"135027830c065c9ab089c028eaa85ca6","tt_content",299,"image",,,,0,0,"sys_file_reference",127,,,,,,,,, +,"25f3b71b67f29fa33fbfd4fa2d930b70","tt_content",302,"l18n_parent",,,,0,0,"tt_content",297,,,,,,,,, +,"280d3ef3b0753b733e1a2db6594c249e","sys_file_reference",128,"l10n_parent",,,,0,0,"sys_file_reference",127,,,,,,,,, +,"39433ea4a82060704109046e4828d3c8","sys_file",1,"storage",,,,0,0,"sys_file_storage",1,,,,,,,,, +,"3c5c7becb1384c7157ffe4cf218cb70e","sys_file_reference",126,"uid_local",,,,0,0,"sys_file",1,,,,,,,,, +,"45491331fdb3cba18904110be4b946ea","sys_file",21,"storage",,,,0,0,"sys_file_storage",1,,,,,,,,, +,"4a1e04a83a4a17882682d86f6cd61f3d","tt_content",301,"l18n_parent",,,,0,0,"tt_content",297,,,,,,,,, +,"53b69102e14734a9a5fce0a41e1cd9ae","tt_content",302,"image",,,,0,0,"sys_file_reference",131,,,,,,,,, +,"583b9974d1df1d9efb695cdabfe53a73","pages",91,"l10n_parent",,,,0,0,"pages",89,,,,,,,,, +,"58bc58699db7b2480929ca99490aa0b0","sys_file_reference",132,"uid_local",,,,0,0,"sys_file",1,,,,,,,,, +,"5b968ea4f118b73c63947691a29d6699","sys_file_reference",131,"uid_local",,,,0,0,"sys_file",1,,,,,,,,, +,"6d8283ea74e4379720297750955d2352","sys_file_reference",127,"uid_local",,,,0,0,"sys_file",21,,,,,,,,, +,"7a494c7f7952f3426f3ac471bbb52b07","sys_file_reference",129,"uid_local",,,,0,0,"sys_file",1,,,,,,,,, +,"8ebb17c55331f8a6f72502fe7eff2f62","tt_content",300,"image",,,,1,0,"sys_file_reference",129,,,,,,,,, +,"a37fdd63b3a05fab2257441d4eda7287","tt_content",298,"image",,,,0,0,"sys_file_reference",132,,,,,,,,, +,"ace39676e3513ffcfce4efc9b1d62dba","tt_content",309,"l18n_parent",,,,0,0,"tt_content",298,,,,,,,,, +,"bb9038a252bcfeadc2e1e8a6b5266986","sys_file_metadata",1,"file",,,,0,0,"sys_file",1,,,,,,,,, +,"c78c9588e7aadd6bcfc994551fe0540c","sys_file_metadata",21,"file",,,,0,0,"sys_file",21,,,,,,,,, +,"cee4982ae84071471dea0e697628816a","sys_file_reference",130,"uid_local",,,,0,0,"sys_file",1,,,,,,,,, +,"d43e69f0be8e738554b1ddcf8c308fe8","sys_file_reference",128,"uid_local",,,,0,0,"sys_file",21,,,,,,,,, +,"d7e943556d8e6b915e632fb6662bf13e","pages",90,"l10n_parent",,,,0,0,"pages",89,,,,,,,,, +,"de860b26757d6f074d43d0889997b78d","tt_content",297,"image",,,,0,0,"sys_file_reference",126,,,,,,,,, +,"e0f904d353c83e0d9444cc5fb12fe2a2","tt_content",305,"l18n_parent",,,,0,0,"tt_content",297,,,,,,,,, +,"e722345b4061de39eff2e12c47eada9c","sys_category",1,"items",,,,0,0,"tt_content",297,,,,,,,,, +,"e9f14f7e703c87de513df469131c640f","sys_category",3,"items",,,,0,0,"tt_content",297,,,,,,,,, +,"f310bd8da9dec7e81a6ecb6e9a5ea3bd","sys_category",2,"l10n_parent",,,,0,0,"sys_category",1,,,,,,,,, +,"f68c0805e7b937b9dd993024a7e3e74f","sys_file",21,"metadata",,,,0,0,"sys_file_metadata",21,,,,,,,,, +,"f8d38adb1a451d3ea0ef7d8eba927471","tt_content",303,"image",,,,0,0,"sys_file_reference",130,,,,,,,,, +,"faa0cc96fb4f42924a5d193b7596d3a0","tt_content",300,"image",,,,0,0,"sys_file_reference",128,,,,,,,,, +,"fe80a6589cac9798aa13ab5e0192cb56","sys_file",1,"metadata",,,,0,0,"sys_file_metadata",1,,,,,,,,, diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultPages.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultPages.csv new file mode 100644 index 000000000000..1a2eb2474174 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/DataSet/LiveDefaultPages.csv @@ -0,0 +1,7 @@ +"pages",,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","slug","l10n_state" +,1,0,256,0,0,0,0,0,0,0,0,"Root page","/","{}" +,88,1,256,0,0,0,0,0,0,0,0,"Subpage","/subpage/","{}" +,89,88,256,0,0,0,0,0,0,0,0,"Default language Page","/subpage/default-language-page/","{}" +,90,88,256,0,1,89,0,0,0,0,0,"[DK]Page","/subpage/dk-page/","{""title"":""parent""}" +,91,88,256,0,3,89,0,0,0,0,0,"[PL]Page","/subpage/pl-page/","{""title"":""parent""}" diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs-with-fe_groups.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/EnableFieldsTestImport.csv similarity index 50% rename from typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs-with-fe_groups.csv rename to typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/EnableFieldsTestImport.csv index 1f754b6444df..5511ebdc57a3 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs-with-fe_groups.csv +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/EnableFieldsTestImport.csv @@ -1,9 +1,22 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +fe_groups +,uid,pid,title,subgroup,description,deleted +,1,0,"Group A",,,0 +,2,0,"Group B",,,0 +"fe_users",,,,,,,, +,"uid","pid","username","deleted","usergroup","disable","tx_extbase_type", +,1,0,"usera",0,1,0,, +,2,0,"userb",0,2,0,, "tx_blogexample_domain_model_blog",,,,,,,,, ,"uid","pid","title","description","logo","l18n_diffsource","fe_group","deleted","posts" ,1,1,"Blog1","Blog1 Description",,,,0,0 ,2,1,"Blog2","Blog2 Description",,,1,0,0 ,3,1,"Blog3","Blog3 Description",,,2,0,0 -"sys_refindex",,,,,,,,, -,"hash","tablename","recuid","field","sorting","workspace","ref_table","ref_uid", +"sys_refindex",,,,,,,, +,"hash","tablename","recuid","field","sorting","workspace","ref_table","ref_uid" +,"001cd2e4390e0152274a1a31cabbf067","fe_users",1,"usergroup",0,0,"fe_groups",1 +,"df54ed0e6e6fa030108438926d5c264f","fe_users",2,"usergroup",0,0,"fe_groups",2 ,"cb722646d5c745f583dc5e0f3de5f8ba","tx_blogexample_domain_model_blog",2,"fe_group",0,0,"fe_groups",1, ,"584906a3be1faa5c4d1bfd6dd0328502","tx_blogexample_domain_model_blog",3,"fe_group",0,0,"fe_groups",2, diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/InTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/InTestImport.csv new file mode 100644 index 000000000000..e16e4d066607 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/InTestImport.csv @@ -0,0 +1,30 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog,,,,,,,,,,,,,, +,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,,0,1,3,0,0,0,0,0 +,4,0,Blog4Hidden,"Blog4 Description",,,0,1,0,0,0,0,0,1 +,5,0,Blog5Deleted,"Blog5 Description",,,1,1,3,0,0,0,0,0 +,6,0,Blog6Hidden,"Blog6 Description",,,0,1,0,0,0,0,0,1 +,7,0,BlogNoPosts,"Blog with w/o posts",,,0,0,0,0,0,0,0,0 +tx_blogexample_domain_model_post,,,,,,,,,,,,,,,,,,, +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,l18n_diffsource,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",,1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",,2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",,3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",,4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",,5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",,6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",,7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",,8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",,9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",,10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",,11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",,1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",,11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",,11,1,0,0,0,0,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/IsDirtyTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/IsDirtyTestImport.csv new file mode 100644 index 000000000000..c44f15b53227 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/IsDirtyTestImport.csv @@ -0,0 +1,21 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,,0,1,3,0,0,0,0,0 +,4,0,Blog4Hidden,"Blog4 Description",,,0,1,0,0,0,0,0,1 +,5,0,Blog5Deleted,"Blog5 Description",,,1,1,3,0,0,0,0,0 +,6,0,Blog6Hidden,"Blog6 Description",,,0,1,0,0,0,0,0,1 +"fe_users" +,"uid","pid","username","deleted","usergroup","disable","tx_extbase_type", +,1,0,"usera",0,1,0,, +,2,0,"userb",0,2,0,, +,3,0,"administratora",0,"1,2",0,"TYPO3Tests\BlogExample\Domain\Model\Administrator", +,4,0,"administratorb",0,"1,2",0,"TYPO3Tests\BlogExample\Domain\Model\Administrator", +fe_groups +,uid,pid,title,subgroup,description,deleted +,1,0,"Group A",,,0 +,2,0,"Group B",,,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyLoadingProxyTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyLoadingProxyTestImport.csv new file mode 100644 index 000000000000..136e1b35c92a --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyLoadingProxyTestImport.csv @@ -0,0 +1,3 @@ +"fe_users" +,"uid","pid","username","deleted","usergroup","disable","tx_extbase_type" +,1,0,"Blog Admin",0,1,0,"TYPO3Tests\BlogExample\Domain\Model\Administrator" diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyObjectStorageTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyObjectStorageTestImport.csv new file mode 100644 index 000000000000..575e9ec44b90 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/LazyObjectStorageTestImport.csv @@ -0,0 +1,15 @@ +tx_blogexample_domain_model_blog,,,,,,,,,,,,,, +,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post,,,,,,,,,,,,,,,,,,, +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,l18n_diffsource,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",,1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",,2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",,3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",,4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",,5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",,6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",,7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",,8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",,9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",,10,0,0,0,0,0,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/OperatorTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/OperatorTestImport.csv new file mode 100644 index 000000000000..8737ac24fc37 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/OperatorTestImport.csv @@ -0,0 +1,19 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryLocalizedDataTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryLocalizedDataTestImport.csv new file mode 100644 index 000000000000..2a152b3a90e3 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryLocalizedDataTestImport.csv @@ -0,0 +1,73 @@ +"pages" +,"uid","pid","sorting","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title" +,1,0,256,0,0,0,0,0,0,"FunctionalTest" +,20,1,256,0,0,0,0,0,0,"Blog example test" +"tx_blogexample_domain_model_blog" +,"uid","pid","title","sys_language_uid","l18n_parent","administrator","subtitle","description","t3_origuid","deleted","hidden","posts","logo" +,1,20,"Blog 1",0,0,0,,,0,0,0,10, +,2,20,"Blog 1 DK",1,1,0,,,1,0,0,6, +"tx_blogexample_domain_model_post" +,"uid","pid","sorting","title","sys_language_uid","l18n_parent","blog","tags","comments","content","author","second_author","reviewer","related_posts","t3_origuid","deleted","hidden" +,1,20,256,"Post 1 - not translated",0,0,1,3,0,"G - content",1,3,1,0,0,0,0 +,2,20,512,"Post 2",0,0,1,3,0,"B - content",1,1,3,2,0,0,0 +,3,20,768,"Post 3",0,0,1,0,0,"I - content",1,1,1,0,0,0,0 +,4,20,1024,"Post 4",0,0,1,0,0,"A - content",1,1,1,0,0,0,0 +,5,20,1280,"Post 5",0,0,1,0,0,"Z - content",1,1,1,0,0,0,0 +,6,20,1536,"Post 6",0,0,1,0,0,"F - content",1,1,1,0,0,0,0 +,7,20,1792,"Post 7",0,0,1,0,0,"C - content",1,1,1,0,0,0,0 +,8,20,2048,"Post 8",0,0,1,0,0,"K - content",1,1,1,0,0,0,0 +,9,20,2304,"Post 9",0,0,1,0,0,"W - content",1,1,1,0,0,0,0 +,10,20,2560,"Post 10",0,0,1,0,0,"U - content",1,1,1,0,0,0,0 +,11,20,2816,"Post 2 - DK",1,2,2,5,0,"C - content",1,1,1,2,2,0,0 +,12,20,3072,"Post 4 - DK",1,4,2,0,0,"U - content",1,1,1,0,4,0,0 +,13,20,3328,"Post 5 - DK",1,5,2,0,0,"A - content",1,1,1,0,5,0,0 +,14,20,3584,"Post 7 - DK",1,7,2,0,0,"S - content",1,1,1,0,7,0,0 +,15,20,4096,"Post DK only",1,0,2,0,0,"B - content",1,1,1,0,10,0,0 +"tx_blogexample_domain_model_comment" +,"uid","pid","content","post","author","deleted","hidden","date" +,1,20,"Comment 1",2,,0,0,"2018-08-27 13:43:53" +"tx_blogexample_domain_model_person" +,"uid","pid","firstname","lastname","sys_language_uid","l10n_parent","email","tags","tags_special","deleted","hidden" +,1,20,"John","Doe",0,0,,0,0,0,0 +,2,20,"Translated John","Doe",1,1,,0,0,0,0 +,3,20,"Never translate me henry","Doe",0,0,,0,0,0,0 +"tx_blogexample_domain_model_tag" +,"uid","pid","name","sys_language_uid","l18n_parent","deleted","hidden" +,1,20,"Tag1",0,0,0,0 +,2,20,"Tag2",0,0,0,0 +,3,20,"Tag3",0,0,0,0 +,4,20,"Tag4",0,0,0,0 +,5,20,"Tag5",0,0,0,0 +,6,20,"Tag6",0,0,0,0 +,7,20,"Tag7",0,0,0,0 +,8,20,"Tag8",0,0,0,0 +,9,20,"Tag9",0,0,0,0 +,10,20,"Tag10",0,0,0,0 +,11,20,"Tag11",0,0,0,0 +,12,20,"Tag12",0,0,0,0 +,13,20,"Tag13",1,0,0,0 +,14,20,"Tag14",1,0,0,0 +,15,20,"Tag15",1,0,0,0 +,16,20,"Tag 1 DK",1,1,0,0 +,17,20,"Tag 2 DK",1,2,0,0 +,18,20,"Tag 3 DK",1,3,0,0 +,19,20,"Tag 6 DK",1,6,0,0 +"tx_blogexample_domain_model_tag_mm" +,"uid_local","uid_foreign","tablenames","fieldname","sorting","sorting_foreign" +,1,1,"tx_blogexample_domain_model_post","tags",1,1 +,2,1,"tx_blogexample_domain_model_post","tags",1,2 +,3,1,"tx_blogexample_domain_model_post","tags",1,3 +,2,2,"tx_blogexample_domain_model_post","tags",2,1 +,3,2,"tx_blogexample_domain_model_post","tags",2,2 +,4,2,"tx_blogexample_domain_model_post","tags",1,3 +,3,11,"tx_blogexample_domain_model_post","tags",2,1 +,4,11,"tx_blogexample_domain_model_post","tags",2,2 +,5,11,"tx_blogexample_domain_model_post","tags",1,3 +,6,11,"tx_blogexample_domain_model_post","tags",1,4 +,7,11,"tx_blogexample_domain_model_post","tags",1,5 +"tx_blogexample_post_post_mm" +,"uid_local","uid_foreign","sorting","sorting_foreign" +,1,2,0,1 +,4,2,0,2 +,1,11,0,1 +,4,11,0,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryParserTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryParserTestImport.csv new file mode 100644 index 000000000000..ecd4ed44506c --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/QueryParserTestImport.csv @@ -0,0 +1,81 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +"fe_users" +,"uid","pid","username","deleted","usergroup","disable","tx_extbase_type" +,1,0,"usera",0,1,0, +,2,0,"userb",0,2,0, +,3,0,"administratora",0,"1,2",0,"TYPO3Tests\BlogExample\Domain\Model\Administrator" +,4,0,"administratorb",0,"1,2",0,"TYPO3Tests\BlogExample\Domain\Model\Administrator" +fe_groups +,uid,pid,title,subgroup,deleted +,1,0,"Group A",,0 +,2,0,"Group B",,0 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,0,1,3,0,0,0,0,0 +,4,0,Blog4Hidden,"Blog4 Description",,0,1,0,0,0,0,0,1 +,5,0,Blog5Deleted,"Blog5 Description",,1,1,3,0,0,0,0,0 +,6,0,Blog6Hidden,"Blog6 Description",,0,1,0,0,0,0,0,1 +,7,0,BlogNoPosts,"Blog with w/o posts",,0,0,0,0,0,0,0,0 +,101,0,"WorkspaceOverlay Blog1","WorkspaceOverlay Blog1 Description",,0,10,0,2,1,0,1,0 +,102,0,"WorkspaceOverlay Blog6Enabled","WorkspaceOverlay Blog6 Description",,0,1,0,1,6,0,1,0 +,103,0,"WorkspaceOverlay Blog2HiddenInWorkspace","WorkspaceOverlay Blog2HiddenInWorkspace Description",,0,1,0,0,2,0,1,1 +,104,0,"WorkspaceOverlay Blog4HiddenInLiveAndWorkspace","WorkspaceOverlay Blog4HiddenInLiveAndWorkspace Description",,0,1,0,0,4,0,1,1 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_post +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +,101,0,121319,1,3,2,10,1502275450,3,"WorkspaceOverlay Post1","WorkspaceOverlay Lorem ipsum...",1,0,0,1,1,0,1 +,102,0,0,1,2,2,1,1502275450,0,"WorkspaceOverlay Post2","WorkspaceOverlay Lorem ipsum...",2,0,0,0,2,0,1 +,103,0,0,1,2,1,1,1502275450,0,"WorkspaceOverlay Post3","WorkspaceOverlay Lorem ipsum...",3,0,0,0,3,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,11,1,"tx_blogexample_domain_model_person","tags",1,1 +,12,12,"tx_blogexample_domain_model_post","tags",1,1 +,12,13,"tx_blogexample_domain_model_post","tags",2,1 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestImport.csv new file mode 100644 index 000000000000..6c274019162a --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestImport.csv @@ -0,0 +1,87 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddPostToBlogInTheMiddle.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddPostToBlogInTheMiddle.csv new file mode 100644 index 000000000000..f965b390e87e --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddPostToBlogInTheMiddle.csv @@ -0,0 +1,88 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,11,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,0,Post6,"Lorem ipsum...",7,0,0,0,0,0,0 +,7,0,1,1,2,1,0,Post7,"Lorem ipsum...",8,0,0,0,0,0,0 +,8,0,1,1,2,1,0,Post8,"Lorem ipsum...",9,0,0,0,0,0,0 +,9,0,1,1,2,1,0,Post9, "Lorem ipsum...",10,0,0,0,0,0,0 +,10,0,1,1,2,1,0,Post10,"Lorem ipsum...",11,0,0,0,0,0,0 +,11,0,2,2,1,0,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +,31,0,1,0,0,0,0,"INSERTED POST at position 6","Bla Bla Bla",6,0,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddTagToPostInTheMiddle.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddTagToPostInTheMiddle.csv new file mode 100644 index 000000000000..7e705473edf1 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAddTagToPostInTheMiddle.csv @@ -0,0 +1,89 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,11,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +,15,0,0,INSERTED TAG at position 6 : ,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,7 +,7,1,tx_blogexample_domain_model_post,tags,1,8 +,8,1,tx_blogexample_domain_model_post,tags,1,9 +,9,1,tx_blogexample_domain_model_post,tags,1,10 +,10,1,tx_blogexample_domain_model_post,tags,1,11 +,15,1,tx_blogexample_domain_model_post,tags,0,6 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachPostToBlogAtTheEnd.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachPostToBlogAtTheEnd.csv new file mode 100644 index 000000000000..20c56169e23c --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachPostToBlogAtTheEnd.csv @@ -0,0 +1,88 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,11,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +,31,0,1,0,0,0,0,"sdufhisdhuf","Bla Bla Bla",11,0,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachTagToPostAtTheEnd.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachTagToPostAtTheEnd.csv new file mode 100644 index 000000000000..ead13215c57d --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultAttachTagToPostAtTheEnd.csv @@ -0,0 +1,89 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,11,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +,15,0,0,sdufhisdhuf,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +,15,1,tx_blogexample_domain_model_post,tags,0,11 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMovePostFromEndToTheMiddle.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMovePostFromEndToTheMiddle.csv new file mode 100644 index 000000000000..0af6ea1e929c --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMovePostFromEndToTheMiddle.csv @@ -0,0 +1,87 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",7,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",8,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",9,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",10,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,MOVED POST Post10,"Lorem ipsum...",6,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMoveTagFromEndToTheMiddle.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMoveTagFromEndToTheMiddle.csv new file mode 100644 index 000000000000..1da242659df1 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultMoveTagFromEndToTheMiddle.csv @@ -0,0 +1,87 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,7 +,7,1,tx_blogexample_domain_model_post,tags,1,8 +,8,1,tx_blogexample_domain_model_post,tags,1,9 +,9,1,tx_blogexample_domain_model_post,tags,1,10 +,10,1,tx_blogexample_domain_model_post,tags,1,6 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastPostFromBlog.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastPostFromBlog.csv new file mode 100644 index 000000000000..e0ba8ddccad1 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastPostFromBlog.csv @@ -0,0 +1,87 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,9,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,0,1,2,1,1502275450,0,Post10,"Lorem ipsum...",0,1,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastTagFromPost.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastTagFromPost.csv new file mode 100644 index 000000000000..dfddbf7a23c0 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveLastTagFromPost.csv @@ -0,0 +1,86 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,9,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddlePostFromBlog.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddlePostFromBlog.csv new file mode 100644 index 000000000000..a1a703ff48c4 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddlePostFromBlog.csv @@ -0,0 +1,87 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,9,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,0,1,0,1,1502275450,0,Post5,"Lorem ipsum...",0,1,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,5,1,tx_blogexample_domain_model_post,tags,1,5 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddleTagFromPost.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddleTagFromPost.csv new file mode 100644 index 000000000000..88faa371b04d --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RelationTestResultRemoveMiddleTagFromPost.csv @@ -0,0 +1,86 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,1,3,2,9,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +tx_blogexample_domain_model_person +,uid,pid,firstname,lastname,salutation,email,tags,tags_special +,1,0,Author,"With tag and special tag","",author-1@test.typo3.org,2,2 +,2,0,Author,"With tag","",author-2@test.typo3.org,1,0 +,3,0,Author,"With special tag","",author-3@test.typo3.org,0,1 +,4,0,"Another Author","With special tag","Mr.",author-4@test.typo3.org,0,1 +tx_blogexample_domain_model_tag +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_tag_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,11,tx_blogexample_domain_model_person,tags,1,1 +,1,13,tx_blogexample_domain_model_person,tags_special,2,1 +,2,11,tx_blogexample_domain_model_person,tags,1,2 +,3,13,tx_blogexample_domain_model_person,tags_special,1,2 +,4,13,tx_blogexample_domain_model_person,tags_special,1,3 +,1,14,tx_blogexample_domain_model_person,tags,3,1 +,1,14,tx_blogexample_domain_model_person,tags_special,4,2 +,1,1,tx_blogexample_domain_model_post,tags,1,1 +,2,1,tx_blogexample_domain_model_post,tags,1,2 +,3,1,tx_blogexample_domain_model_post,tags,1,3 +,4,1,tx_blogexample_domain_model_post,tags,1,4 +,6,1,tx_blogexample_domain_model_post,tags,1,6 +,7,1,tx_blogexample_domain_model_post,tags,1,7 +,8,1,tx_blogexample_domain_model_post,tags,1,8 +,9,1,tx_blogexample_domain_model_post,tags,1,9 +,10,1,tx_blogexample_domain_model_post,tags,1,10 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RepositoryTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RepositoryTestImport.csv new file mode 100644 index 000000000000..a2b211f8e2f7 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/RepositoryTestImport.csv @@ -0,0 +1,26 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,,0,1,3,0,0,0,0,0 +tx_blogexample_domain_model_post +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,l18n_diffsource,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",,1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",,2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",,3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",,4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",,5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",,6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",,7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",,8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",,9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",,10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",,11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",,1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",,11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",,11,1,0,0,0,0,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/TranslationTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/TranslationTestImport.csv new file mode 100644 index 000000000000..b67275680542 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/TranslationTestImport.csv @@ -0,0 +1,31 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +"tx_blogexample_domain_model_blog" +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,1,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +"tx_blogexample_domain_model_post" +,uid,pid,blog,content,title,deleted,l18n_parent,sys_language_uid,hidden +,1,1,1,"Lorem ipsum","Post1",0,0,0,0 +,2,1,1,"Lorem ipsum","B EN:Post1",0,1,1,0 +,3,1,1,"Lorem ipsum","GR:Post1",0,1,2,0 +,4,1,1,"Lorem ipsum","Post2",0,0,0,0 +,5,1,1,"Lorem ipsum","A EN:Post2",0,4,1,0 +,6,1,1,"Lorem ipsum","Post3",0,0,0,0 +,10,1,1,"Lorem ipsum","Post10",0,0,0,1 +,11,1,1,"Lorem ipsum","GR:Post10",0,10,2,1 +,12,1,1,"Lorem ipsum","Post11",0,0,0,0 +,13,1,1,"Lorem ipsum","GR:Post11",0,12,2,0 +"tx_blogexample_domain_model_tag" +,uid,pid,items,name,deleted +,1,1,3,"Tag1",0 +,2,1,0,"Tag2",0 +,3,1,0,Tag3,1 +"tx_blogexample_domain_model_tag_mm" +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,"tx_blogexample_domain_model_post","tags",1,1 +,1,4,"tx_blogexample_domain_model_post","tags",2,1 +,1,6,"tx_blogexample_domain_model_post","tags",3,1 +,1,5,"tx_blogexample_domain_model_post","tags",4,1 +,1,2,"tx_blogexample_domain_model_post","tags",5,1 +,2,2,"tx_blogexample_domain_model_post","tags",1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/WorkspaceTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/WorkspaceTestImport.csv new file mode 100644 index 000000000000..dcdea2bf01a7 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/WorkspaceTestImport.csv @@ -0,0 +1,59 @@ +"pages" +,"uid","pid","sorting","title","deleted","perms_everybody" +,1,0,128,"Root",0,15 +tx_blogexample_domain_model_blog +,uid,pid,title,description,logo,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden +,1,0,Blog1,"Blog1 Description",,0,10,0,0,0,0,0,0 +,2,0,Blog2,"Blog2 Description",,0,1,4,0,0,0,0,0 +,3,0,Blog3,"Blog3 Description",,0,1,3,0,0,0,0,0 +,4,0,Blog4Hidden,"Blog4 Description",,0,1,0,0,0,0,0,1 +,5,0,Blog5Deleted,"Blog5 Description",,1,1,3,0,0,0,0,0 +,6,0,Blog6Hidden,"Blog6 Description",,0,1,0,0,0,0,0,1 +,7,0,BlogNoPosts,"Blog with w/o posts",,0,0,0,0,0,0,0,0 +,101,0,"WorkspaceOverlay Blog1","WorkspaceOverlay Blog1 Description",,0,10,0,2,1,0,1,0 +,102,0,"WorkspaceOverlay Blog6Enabled","WorkspaceOverlay Blog6 Description",,0,1,0,1,6,0,1,0 +,103,0,"WorkspaceOverlay Blog2HiddenInWorkspace","WorkspaceOverlay Blog2HiddenInWorkspace Description",,0,1,0,0,2,0,1,1 +,104,0,"WorkspaceOverlay Blog4HiddenInLiveAndWorkspace","WorkspaceOverlay Blog4HiddenInLiveAndWorkspace Description",,0,1,0,0,4,0,1,1 +tx_blogexample_domain_model_post +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",11,1,0,0,0,0,0 +,101,0,121319,1,3,2,10,1502275450,3,"WorkspaceOverlay Post1","WorkspaceOverlay Lorem ipsum...",1,0,0,1,1,0,1 +,102,0,0,1,2,2,1,1502275450,0,"WorkspaceOverlay Post2","WorkspaceOverlay Lorem ipsum...",2,0,0,0,2,0,1 +,103,0,0,1,2,1,1,1502275450,0,"WorkspaceOverlay Post3","WorkspaceOverlay Lorem ipsum...",3,0,0,0,3,0,1 +sys_category +,uid,pid,title,deleted,hidden +,1,0,"Category 1",0,0 +,2,0,"Category 2",0,0 +,3,0,"Category 3",0,0 +,4,0,"Category 4",0,0 +,5,0,"Category 5",0,1 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign +,1,1,tx_blogexample_domain_model_post,categories,1,1 +,2,1,tx_blogexample_domain_model_post,categories,1,2 +,3,1,tx_blogexample_domain_model_post,categories,1,3 +,5,1,tx_blogexample_domain_model_post,categories,1,4 +,1,2,tx_blogexample_domain_model_post,categories,1,2 +,4,1,tx_my_extension,categories,1,2 +,4,5,tx_my_extension,categories,1,2 +,1,1,tx_blogexample_domain_model_blog,categories,1,1 +,2,1,tx_blogexample_domain_model_blog,categories,1,2 +,4,1,tx_blogexample_domain_model_blog,categories,1,3 +,2,2,tx_blogexample_domain_model_blog,categories,1,1 +,3,101,tx_blogexample_domain_model_blog,categories,1,1 +,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/categories.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/categories.csv deleted file mode 100644 index 67f6fddc9e73..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/categories.csv +++ /dev/null @@ -1,7 +0,0 @@ -sys_category,,,,,,, -,uid,pid,title,l10n_diffsource,description,deleted,hidden -,1,0,"Category 1",,,0,0 -,2,0,"Category 2",,,0,0 -,3,0,"Category 3",,,0,0 -,4,0,"Category 4",,,0,0 -,5,0,"Category 5",,,0,1 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/category-mm.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/category-mm.csv deleted file mode 100644 index f903bfde266d..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/category-mm.csv +++ /dev/null @@ -1,15 +0,0 @@ -sys_category_record_mm,,,,,, -,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign -,1,1,tx_blogexample_domain_model_post,categories,1,1 -,2,1,tx_blogexample_domain_model_post,categories,1,2 -,3,1,tx_blogexample_domain_model_post,categories,1,3 -,5,1,tx_blogexample_domain_model_post,categories,1,4 -,1,2,tx_blogexample_domain_model_post,categories,1,2 -,4,1,tx_my_extension,categories,1,2 -,4,5,tx_my_extension,categories,1,2 -,1,1,tx_blogexample_domain_model_blog,categories,1,1 -,2,1,tx_blogexample_domain_model_blog,categories,1,2 -,4,1,tx_blogexample_domain_model_blog,categories,1,3 -,2,2,tx_blogexample_domain_model_blog,categories,1,1 -,3,101,tx_blogexample_domain_model_blog,categories,1,1 -,1,101,tx_blogexample_domain_model_blog,categories,1,2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/comments.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/comments.csv deleted file mode 100644 index 45ca83f8d01f..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/comments.csv +++ /dev/null @@ -1,7 +0,0 @@ -tx_blogexample_domain_model_comment,,,,, -,uid,pid,post,author,content,date -,1,0,1,1,Comment1,"2023-01-05 00:00:00" -,2,0,1,2,Comment2,"2023-01-06 00:00:00" -,3,0,1,1,Comment3,"2023-02-23 00:00:00" -,4,0,1,3,Comment4,"2023-02-25 00:00:00" -,5,0,1,2,Comment5,"2023-03-08 00:00:00" diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv deleted file mode 100644 index 23b14d9473c5..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv +++ /dev/null @@ -1,4 +0,0 @@ -fe_groups -,uid,pid,title,subgroup,description,deleted -,1,0,"Group A",,,0 -,2,0,"Group B",,,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.csv deleted file mode 100644 index 3e13cd403374..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.csv +++ /dev/null @@ -1,14 +0,0 @@ -"fe_users",,,,,,,, -,"uid","pid","username","deleted","usergroup","disable","tx_extbase_type", -,1,0,"usera",0,1,0,, -,2,0,"userb",0,2,0,, -,3,0,"administratora",0,"1,2",0,"TYPO3Tests\BlogExample\Domain\Model\Administrator", -,4,0,"administratorb",0,"1,2",0,"TYPO3Tests\BlogExample\Domain\Model\Administrator", -"sys_refindex",,,,,,,, -,"hash","tablename","recuid","field","sorting","workspace","ref_table","ref_uid" -,"001cd2e4390e0152274a1a31cabbf067","fe_users",1,"usergroup",0,0,"fe_groups",1 -,"df54ed0e6e6fa030108438926d5c264f","fe_users",2,"usergroup",0,0,"fe_groups",2 -,"121e4c7af1a67d742beae6f5495860d9","fe_users",3,"usergroup",0,0,"fe_groups",1 -,"1ea5a92bdcf97a86381068c38080e25b","fe_users",3,"usergroup",1,0,"fe_groups",2 -,"cca234ba287dceaefadd4e6eed797393","fe_users",4,"usergroup",0,0,"fe_groups",1 -,"ff1fd3eb4edf533f313b5fba99f361f5","fe_users",4,"usergroup",1,0,"fe_groups",2 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/persons.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/persons.csv deleted file mode 100644 index f9151aa9963d..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/persons.csv +++ /dev/null @@ -1,6 +0,0 @@ -tx_blogexample_domain_model_person,,,,,,, -,uid,pid,firstname,lastname,email,tags,tags_special -,1,0,Author,"With tag and special tag",author-1@test.typo3.org,2,2 -,2,0,Author,"With tag",author-2@test.typo3.org,1,0 -,3,0,Author,"With special tag",author-3@test.typo3.org,0,1 -,4,0,"Another Author","With special tag",author-4@test.typo3.org,0,1 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-post-mm.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-post-mm.csv deleted file mode 100644 index 5c3e5dcd3a59..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-post-mm.csv +++ /dev/null @@ -1,3 +0,0 @@ -tx_blogexample_post_post_mm,,,, -,uid_local,uid_foreign,sorting,sorting_foreign -,2,1,1,1 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-tag-mm.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-tag-mm.csv deleted file mode 100644 index 1b904cf1dd6d..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/post-tag-mm.csv +++ /dev/null @@ -1,24 +0,0 @@ -tx_blogexample_post_tag_mm,,,, -,uid_local,uid_foreign,sorting,sorting_foreign -,1,1,1,1 -,1,2,2,1 -,1,3,3,1 -,1,4,4,1 -,1,5,5,1 -,1,6,6,1 -,1,7,7,1 -,1,8,8,1 -,1,9,9,1 -,1,10,10,1 -,2,1,1,2 -,2,11,2,1 -,3,1,1,3 -,4,1,1,4 -,5,1,1,5 -,6,1,1,6 -,7,1,1,7 -,8,1,1,8 -,9,1,1,9 -,10,1,1,10 -,12,12,1,10 -,13,12,1,10 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags-mm.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags-mm.csv deleted file mode 100644 index 363e7c30f385..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags-mm.csv +++ /dev/null @@ -1,9 +0,0 @@ -tx_blogexample_domain_model_tag_mm,,,,,, -,uid_local,uid_foreign,tablenames,fieldname,sorting,sorting_foreign -,1,11,tx_blogexample_domain_model_person,tags,1,1 -,1,13,tx_blogexample_domain_model_person,tags_special,1,1 -,2,11,tx_blogexample_domain_model_person,tags,1,1 -,3,13,tx_blogexample_domain_model_person,tags_special,1,1 -,4,13,tx_blogexample_domain_model_person,tags_special,1,1 -,1,14,tx_blogexample_domain_model_person,tags,1,1 -,1,14,tx_blogexample_domain_model_person,tags_special,1,1 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.csv deleted file mode 100644 index f963a3965ecc..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.csv +++ /dev/null @@ -1,16 +0,0 @@ -tx_blogexample_domain_model_tag,,,,, -,uid,pid,posts,name,deleted -,1,0,10,Tag1,0 -,2,0,2,Tag2,0 -,3,0,1,Tag3,0 -,4,0,1,Tag4,0 -,5,0,1,Tag5,0 -,6,0,1,Tag6,0 -,7,0,1,Tag7,0 -,8,0,1,Tag8,0 -,9,0,1,Tag9,0 -,10,0,1,Tag10,0 -,11,0,0,TagForAuthor1,0 -,12,0,0,Tag12,0 -,13,0,0,SpecialTagForAuthor1,0 -,14,0,0,SharedTag,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.csv deleted file mode 100644 index e6f012f2aff0..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translated-posts.csv +++ /dev/null @@ -1,12 +0,0 @@ -tx_blogexample_domain_model_post,,,,,,,,,, -,uid,pid,blog,content,title,deleted,l18n_diffsource,l18n_parent,sys_language_uid,hidden -,1,1,1,"Lorem ipsum",Post1,0,,0,0,0 -,2,1,1,"Lorem ipsum","B EN:Post1",0,,1,1,0 -,3,1,1,"Lorem ipsum",GR:Post1,0,,1,2,0 -,4,1,1,"Lorem ipsum",Post2,0,,0,0,0 -,5,1,1,"Lorem ipsum","A EN:Post2",0,,4,1,0 -,6,1,1,"Lorem ipsum",Post3,0,,0,0,0 -,10,1,1,"Lorem ipsum",Post10,0,,0,0,1 -,11,1,1,"Lorem ipsum",GR:Post10,0,,10,2,1 -,12,1,1,"Lorem ipsum",Post11,0,,0,0,0 -,13,1,1,"Lorem ipsum",GR:Post11,0,,12,2,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translatedBlogExampleData.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translatedBlogExampleData.csv deleted file mode 100644 index 626361349604..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/translatedBlogExampleData.csv +++ /dev/null @@ -1,73 +0,0 @@ -"pages",,,,,,,,,,,,,,,,, -,"uid","pid","sorting","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,, -,1,0,256,0,0,0,0,0,0,"FunctionalTest",,,,,,, -,20,1,256,0,0,0,0,0,0,"Blog example test",,,,,,, -"tx_blogexample_domain_model_blog",,,,,,,,,,,,,,,,, -,"uid","pid","title","sys_language_uid","l18n_parent","administrator","subtitle","description","t3_origuid","deleted","hidden","posts","logo",,,, -,1,20,"Blog 1",0,0,0,,,0,0,0,10,,,,, -,2,20,"Blog 1 DK",1,1,0,,,1,0,0,6,,,,, -"tx_blogexample_domain_model_post",,,,,,,,,,,,,,,,, -,"uid","pid","sorting","title","sys_language_uid","l18n_parent","blog","tags","comments","content","author","second_author","reviewer","related_posts","t3_origuid","deleted","hidden" -,1,20,256,"Post 1 - not translated",0,0,1,3,0,"G - content",1,3,1,0,0,0,0 -,2,20,512,"Post 2",0,0,1,3,0,"B - content",1,1,3,2,0,0,0 -,3,20,768,"Post 3",0,0,1,0,0,"I - content",1,1,1,0,0,0,0 -,4,20,1024,"Post 4",0,0,1,0,0,"A - content",1,1,1,0,0,0,0 -,5,20,1280,"Post 5",0,0,1,0,0,"Z - content",1,1,1,0,0,0,0 -,6,20,1536,"Post 6",0,0,1,0,0,"F - content",1,1,1,0,0,0,0 -,7,20,1792,"Post 7",0,0,1,0,0,"C - content",1,1,1,0,0,0,0 -,8,20,2048,"Post 8",0,0,1,0,0,"K - content",1,1,1,0,0,0,0 -,9,20,2304,"Post 9",0,0,1,0,0,"W - content",1,1,1,0,0,0,0 -,10,20,2560,"Post 10",0,0,1,0,0,"U - content",1,1,1,0,0,0,0 -,11,20,2816,"Post 2 - DK",1,2,2,5,0,"C - content",1,1,1,2,2,0,0 -,12,20,3072,"Post 4 - DK",1,4,2,0,0,"U - content",1,1,1,0,4,0,0 -,13,20,3328,"Post 5 - DK",1,5,2,0,0,"A - content",1,1,1,0,5,0,0 -,14,20,3584,"Post 7 - DK",1,7,2,0,0,"S - content",1,1,1,0,7,0,0 -,15,20,4096,"Post DK only",1,0,2,0,0,"B - content",1,1,1,0,10,0,0 -"tx_blogexample_domain_model_comment",,,,,,,,,,,,,,,,, -,"uid","pid","content","post","author","deleted","hidden","date",,,,,,,,, -,1,20,"Comment 1",2,,0,0,"2018-08-27 13:43:53",,,,,,,,, -"tx_blogexample_domain_model_person",,,,,,,,,,,,,,,,, -,"uid","pid","firstname","lastname","sys_language_uid","l10n_parent","email","tags","tags_special","deleted","hidden",,,,,, -,1,20,"John","Doe",0,0,,0,0,0,0,,,,,, -,2,20,"Translated John","Doe",1,1,,0,0,0,0,,,,,, -,3,20,"Never translate me henry","Doe",0,0,,0,0,0,0,,,,,, -"tx_blogexample_domain_model_tag",,,,,,,,,,,,,,,,, -,"uid","pid","name","sys_language_uid","l18n_parent","deleted","hidden",,,,,,,,,, -,1,20,"Tag1",0,0,0,0,,,,,,,,,, -,2,20,"Tag2",0,0,0,0,,,,,,,,,, -,3,20,"Tag3",0,0,0,0,,,,,,,,,, -,4,20,"Tag4",0,0,0,0,,,,,,,,,, -,5,20,"Tag5",0,0,0,0,,,,,,,,,, -,6,20,"Tag6",0,0,0,0,,,,,,,,,, -,7,20,"Tag7",0,0,0,0,,,,,,,,,, -,8,20,"Tag8",0,0,0,0,,,,,,,,,, -,9,20,"Tag9",0,0,0,0,,,,,,,,,, -,10,20,"Tag10",0,0,0,0,,,,,,,,,, -,11,20,"Tag11",0,0,0,0,,,,,,,,,, -,12,20,"Tag12",0,0,0,0,,,,,,,,,, -,13,20,"Tag13",1,0,0,0,,,,,,,,,, -,14,20,"Tag14",1,0,0,0,,,,,,,,,, -,15,20,"Tag15",1,0,0,0,,,,,,,,,, -,16,20,"Tag 1 DK",1,1,0,0,,,,,,,,,, -,17,20,"Tag 2 DK",1,2,0,0,,,,,,,,,, -,18,20,"Tag 3 DK",1,3,0,0,,,,,,,,,, -,19,20,"Tag 6 DK",1,6,0,0,,,,,,,,,, -"tx_blogexample_post_tag_mm",,,,,,,,,,,,,,,,, -,"uid_local","uid_foreign","sorting","sorting_foreign",,,,,,,,,,,,, -,1,1,1,0,,,,,,,,,,,,, -,1,2,2,0,,,,,,,,,,,,, -,1,3,3,0,,,,,,,,,,,,, -,2,2,1,0,,,,,,,,,,,,, -,2,3,2,0,,,,,,,,,,,,, -,2,4,3,0,,,,,,,,,,,,, -,11,3,1,0,,,,,,,,,,,,, -,11,4,2,0,,,,,,,,,,,,, -,11,5,3,0,,,,,,,,,,,,, -,11,6,4,0,,,,,,,,,,,,, -,11,7,5,0,,,,,,,,,,,,, -"tx_blogexample_post_post_mm",,,,,,,,,,,,,,,,, -,"uid_local","uid_foreign","sorting","sorting_foreign",,,,,,,,,,,,, -,1,2,0,1,,,,,,,,,,,,, -,4,2,0,2,,,,,,,,,,,,, -,1,11,0,1,,,,,,,,,,,,, -,4,11,0,2,,,,,,,,,,,,, diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/DataMapperTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/DataMapperTest.php index d4e388e1f9d3..acbaebff9a72 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/DataMapperTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/DataMapperTest.php @@ -473,7 +473,7 @@ public function getPlainValueReturnsExpectedValues(string|int $expectedValue, mi */ public function getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyLoadingProxy(): void { - $this->importCSVDataSet('typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/administrators.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/DataMapperTestImport.csv'); $dataMapper = $this->get(DataMapper::class); $rowsBlog = [ [ @@ -493,9 +493,7 @@ public function getPlainValueCallsGetRealInstanceOnInputIfInputIsInstanceOfLazyL */ public function fetchRelatedRespectsForeignDefaultSortByTCAConfiguration(): void { - // Arrange - $this->importCSVDataSet('typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet('typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/comments.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/DataMapperTestImport.csv'); $dataMapper = $this->get(DataMapper::class); diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/DataMapperTestImport.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/DataMapperTestImport.csv new file mode 100644 index 000000000000..7651057a8135 --- /dev/null +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/DataMapperTestImport.csv @@ -0,0 +1,31 @@ +"fe_users" +,"uid","pid","tx_extbase_type" +,1,0,"TYPO3Tests\BlogExample\Domain\Model\Administrator" +tx_blogexample_domain_model_post,,,,,,,,,,,,,,,,,,, +,uid,pid,tstamp,blog,author,reviewer,tags,date,categories,title,content,l18n_diffsource,sorting,deleted,hidden,related_posts,t3ver_oid,t3ver_state,t3ver_wsid +,1,0,121319,1,3,2,10,1502275450,3,Post1,"Lorem ipsum...",,1,0,0,1,0,0,0 +,2,0,0,1,2,2,1,1502275450,0,Post2,"Lorem ipsum...",,2,0,0,0,0,0,0 +,3,0,0,1,2,1,1,1502275450,0,Post3,"Lorem ipsum...",,3,0,0,0,0,0,0 +,4,0,0,1,1,2,1,1502275450,0,Post4,"Lorem ipsum...",,4,0,0,0,0,0,0 +,5,0,0,1,1,0,1,1502275450,0,Post5,"Lorem ipsum...",,5,0,0,0,0,0,0 +,6,0,0,1,0,0,1,1502275450,0,Post6,"Lorem ipsum...",,6,0,0,0,0,0,0 +,7,0,0,1,1,2,1,1502275450,0,Post7,"Lorem ipsum...",,7,0,0,0,0,0,0 +,8,0,0,1,1,2,1,1502275450,0,Post8,"Lorem ipsum...",,8,0,0,0,0,0,0 +,9,0,0,1,1,2,1,1502275450,0,Post9, "Lorem ipsum...",,9,0,0,0,0,0,0 +,10,0,0,1,1,2,1,1502275450,0,Post10,"Lorem ipsum...",,10,0,0,0,0,0,0 +,11,0,0,2,2,1,0,1502275450,0,post1,"Lorem ipsum...",,11,0,0,0,0,0,0 +,12,0,0,3,0,2,1,1502275450,0,"post with tag","Lorem ipsum...",,1,0,0,0,0,0,0 +,13,0,0,3,1,2,0,1502275450,0,"post with tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,14,0,0,3,1,2,1,1502275450,0,"post with tag and tagged author","Lorem ipsum...",,2,0,0,0,0,0,0 +,20,0,0,3,1,3,0,1502275450,0,"post20 hidden","Lorem ipsum...",,11,0,1,0,0,0,0 +,30,0,0,3,1,3,0,1502275450,0,"post30 deleted","Lorem ipsum...",,11,1,0,0,0,0,0 +,101,0,121319,1,3,2,10,1502275450,3,"WorkspaceOverlay Post1","WorkspaceOverlay Lorem ipsum...",,1,0,0,1,1,0,1 +,102,0,0,1,2,2,1,1502275450,0,"WorkspaceOverlay Post2","WorkspaceOverlay Lorem ipsum...",,2,0,0,0,2,0,1 +,103,0,0,1,2,1,1,1502275450,0,"WorkspaceOverlay Post3","WorkspaceOverlay Lorem ipsum...",,3,0,0,0,3,0,1 +tx_blogexample_domain_model_comment,,,,, +,uid,pid,post,author,content,date +,1,0,1,1,Comment1,"2023-01-05 00:00:00" +,2,0,1,2,Comment2,"2023-01-06 00:00:00" +,3,0,1,1,Comment3,"2023-02-23 00:00:00" +,4,0,1,3,Comment4,"2023-02-25 00:00:00" +,5,0,1,2,Comment5,"2023-03-08 00:00:00" diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/administrators.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/administrators.csv deleted file mode 100644 index f73339f26b35..000000000000 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/administrators.csv +++ /dev/null @@ -1,3 +0,0 @@ -"fe_users" -,"uid","pid","tx_extbase_type" -,1,0,"TYPO3Tests\BlogExample\Domain\Model\Administrator" diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Fixtures/Typo3DbBackendTestImport.csv similarity index 73% rename from typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.csv rename to typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Fixtures/Typo3DbBackendTestImport.csv index 59f9a676dbc8..f4b51bb7cae5 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.csv +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Fixtures/Typo3DbBackendTestImport.csv @@ -1,4 +1,20 @@ -tx_blogexample_domain_model_blog,,,,,,,,,,,,,, +tx_blogexample_domain_model_tag,,,,, +,uid,pid,items,name,deleted +,1,0,10,Tag1,0 +,2,0,2,Tag2,0 +,3,0,1,Tag3,0 +,4,0,1,Tag4,0 +,5,0,1,Tag5,0 +,6,0,1,Tag6,0 +,7,0,1,Tag7,0 +,8,0,1,Tag8,0 +,9,0,1,Tag9,0 +,10,0,1,Tag10,0 +,11,0,0,TagForAuthor1,0 +,12,0,0,Tag12,0 +,13,0,0,SpecialTagForAuthor1,0 +,14,0,0,SharedTag,0 +tx_blogexample_domain_model_blog ,uid,pid,title,description,logo,l18n_diffsource,deleted,posts,administrator,categories,t3ver_oid,t3ver_state,t3ver_wsid,hidden ,1,0,Blog1,"Blog1 Description",,,0,10,0,0,0,0,0,0 ,2,0,Blog2,"Blog2 Description",,,0,1,4,0,0,0,0,0 diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbBackendTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbBackendTest.php index e34c9da2ef0e..f90ad76490c5 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbBackendTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbBackendTest.php @@ -45,12 +45,10 @@ final class Typo3DbBackendTest extends FunctionalTestCase */ public function uidOfAlreadyPersistedValueObjectIsDeterminedCorrectly(): void { - $this->importCSVDataSet('typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/Typo3DbBackendTestImport.csv'); $domainObject = new Tag('Tag10'); - $typo3DbBackend = $this->get(Typo3DbBackend::class); $result = $typo3DbBackend->getUidOfAlreadyPersistedValueObject($domainObject); - self::assertSame(10, $result); } @@ -59,7 +57,7 @@ public function uidOfAlreadyPersistedValueObjectIsDeterminedCorrectly(): void */ public function getObjectDataByQueryChangesUidIfInPreview(): void { - $this->importCSVDataSet('typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/Typo3DbBackendTestImport.csv'); $frontendTypoScript = new FrontendTypoScript(new RootNode(), []); $frontendTypoScript->setSetupArray([]); $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest()) diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/InTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/InTest.php index 51097358e57b..1d6573edb8bc 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/InTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/InTest.php @@ -27,7 +27,9 @@ final class InTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected BlogRepository $blogRepository; protected PostRepository $postRepository; @@ -35,16 +37,9 @@ final class InTest extends FunctionalTestCase protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/InTestImport.csv'); $this->blogRepository = $this->get(BlogRepository::class); $this->postRepository = $this->get(PostRepository::class); - $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -56,13 +51,10 @@ public function inConditionWorksWithArrayOfObjects(): void { $blog1 = $this->blogRepository->findByUid(1); $blog2 = $this->blogRepository->findByUid(2); - $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('blog', [$blog1, $blog2]) ); - self::assertSame(11, $inQuery->count()); } @@ -73,21 +65,15 @@ public function inConditionWorksWithArrayOfObjectsOnSecondCall(): void { $blog1 = $this->blogRepository->findByUid(1); $blog2 = $this->blogRepository->findByUid(2); - $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('blog', [$blog1, $blog2]) ); - self::assertSame(11, $inQuery->count()); - $newInQuery = $this->postRepository->createQuery(); - $newInQuery->matching( $newInQuery->in('blog', [$blog1]) ); - self::assertSame(10, $newInQuery->count()); } @@ -98,17 +84,13 @@ public function inConditionWorksWithObjectStorage(): void { $blog1 = $this->blogRepository->findByUid(1); $blog2 = $this->blogRepository->findByUid(2); - $objectStorage = new ObjectStorage(); $objectStorage->attach($blog1); $objectStorage->attach($blog2); - $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('blog', $objectStorage) ); - self::assertSame(11, $inQuery->count()); } @@ -119,28 +101,20 @@ public function inConditionWorksWithObjectStorageOnSecondCall(): void { $blog1 = $this->blogRepository->findByUid(1); $blog2 = $this->blogRepository->findByUid(2); - $objectStorage = new ObjectStorage(); $objectStorage->attach($blog1); $objectStorage->attach($blog2); - $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('blog', $objectStorage) ); - self::assertSame(11, $inQuery->count()); - $newObjectStorage = new ObjectStorage(); $newObjectStorage->attach($blog1); - $newInQuery = $this->postRepository->createQuery(); - $newInQuery->matching( $newInQuery->in('blog', $newObjectStorage) ); - self::assertSame(10, $newInQuery->count()); } @@ -152,13 +126,10 @@ public function inConditionWorksWithQueryResult(): void $query = $this->blogRepository->createQuery(); $query->matching($query->in('uid', [1, 2])); $queryResult = $query->execute(); - $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('blog', $queryResult) ); - self::assertSame(11, $inQuery->count()); } @@ -170,21 +141,15 @@ public function inConditionWorksWithQueryResultOnSecondCall(): void $query = $this->blogRepository->createQuery(); $query->matching($query->in('uid', [1, 2])); $queryResult = $query->execute(); - $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('blog', $queryResult) ); - self::assertSame(11, $inQuery->count()); - $newInQuery = $this->postRepository->createQuery(); - $newInQuery->matching( $newInQuery->in('blog', $queryResult) ); - self::assertSame(11, $newInQuery->count()); } @@ -194,18 +159,11 @@ public function inConditionWorksWithQueryResultOnSecondCall(): void public function inConditionWorksWithLazyObjectStorage(): void { $blog = $this->blogRepository->findByUid(1); - - self::assertInstanceOf( - LazyObjectStorage::class, - $blog->getPosts() - ); - + self::assertInstanceOf(LazyObjectStorage::class, $blog->getPosts()); $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('uid', $blog->getPosts()) ); - self::assertSame(10, $inQuery->count()); } @@ -215,26 +173,16 @@ public function inConditionWorksWithLazyObjectStorage(): void public function inConditionWorksWithLazyObjectStorageOnSecondCall(): void { $blog = $this->blogRepository->findByUid(1); - - self::assertInstanceOf( - LazyObjectStorage::class, - $blog->getPosts() - ); - + self::assertInstanceOf(LazyObjectStorage::class, $blog->getPosts()); $inQuery = $this->postRepository->createQuery(); - $inQuery->matching( $inQuery->in('uid', $blog->getPosts()) ); - self::assertSame(10, $inQuery->count()); - $newInQuery = $this->postRepository->createQuery(); - $newInQuery->matching( $newInQuery->in('uid', $blog->getPosts()) ); - self::assertSame(10, $newInQuery->count()); } } diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/IsDirtyTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/IsDirtyTest.php index 925b399f0ff7..94f2ee748d1b 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/IsDirtyTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/IsDirtyTest.php @@ -27,29 +27,14 @@ final class IsDirtyTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - - protected BlogRepository $blogRepository; - protected AdministratorRepository $adminRepository; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-post-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/persons.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/fe_users.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/fe_groups.csv'); - - $this->blogRepository = $this->get(BlogRepository::class); - $this->adminRepository = $this->get(AdministratorRepository::class); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/IsDirtyTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -59,7 +44,7 @@ protected function setUp(): void */ public function objectFetchedFromDbIsNotDirty(): void { - $blog = $this->blogRepository->findByUid(3); + $blog = $this->get(BlogRepository::class)->findByUid(3); self::assertFalse($blog->_isDirty()); } @@ -68,12 +53,10 @@ public function objectFetchedFromDbIsNotDirty(): void */ public function lazyLoadingProxyReplacedByRealInstanceIsNotDirty(): void { - $blog = $this->blogRepository->findByUid(3); + $blog = $this->get(BlogRepository::class)->findByUid(3); self::assertInstanceOf(LazyLoadingProxy::class, $blog->getAdministrator()); // precondition - - $admin = $this->adminRepository->findByUid(3); + $admin = $this->get(AdministratorRepository::class)->findByUid(3); self::assertInstanceOf(Administrator::class, $admin); // precondition - $blog->setAdministrator($admin); self::assertFalse($blog->_isDirty()); } @@ -83,9 +66,8 @@ public function lazyLoadingProxyReplacedByRealInstanceIsNotDirty(): void */ public function lazyLoadingProxyReplacedByWrongInstanceIsDirty(): void { - $blog = $this->blogRepository->findByUid(3); + $blog = $this->get(BlogRepository::class)->findByUid(3); self::assertInstanceOf(LazyLoadingProxy::class, $blog->getAdministrator()); //precondition - $blog->setAdministrator(new Administrator()); self::assertTrue($blog->_isDirty()); } @@ -95,16 +77,13 @@ public function lazyLoadingProxyReplacedByWrongInstanceIsDirty(): void */ public function realInstanceReplacedByLazyLoadingProxyIsNotDirty(): void { - $blog = $this->blogRepository->findByUid(3); + $blog = $this->get(BlogRepository::class)->findByUid(3); $lazyLoadingProxy = $blog->getAdministrator(); self::assertInstanceOf(LazyLoadingProxy::class, $lazyLoadingProxy); //precondition - - $admin = $this->adminRepository->findByUid(3); + $admin = $this->get(AdministratorRepository::class)->findByUid(3); self::assertInstanceOf(Administrator::class, $admin); // precondition - $blog->setAdministrator($admin); $blog->_memorizeCleanState(); - $blog->_setProperty('administrator', $lazyLoadingProxy); self::assertFalse($blog->_isDirty()); } @@ -114,18 +93,15 @@ public function realInstanceReplacedByLazyLoadingProxyIsNotDirty(): void */ public function lazyLoadingProxyByWrongLazyLoadingProxyIsDirtyAndUpdated(): void { - $blogOne = $this->blogRepository->findByUid(3); + $blogRepository = $this->get(BlogRepository::class); + $blogOne = $blogRepository->findByUid(3); self::assertInstanceOf(LazyLoadingProxy::class, $blogOne->getAdministrator()); //precondition - - $blogTwo = $this->blogRepository->findByUid(2); + $blogTwo = $blogRepository->findByUid(2); self::assertInstanceOf(LazyLoadingProxy::class, $blogTwo->getAdministrator()); //precondition - $blogOne->_setProperty('administrator', $blogTwo->getAdministrator()); self::assertTrue($blogOne->_isDirty()); - - $this->blogRepository->update($blogOne); - - $updatedBlogOne = $this->blogRepository->findByUid(3); + $blogRepository->update($blogOne); + $updatedBlogOne = $blogRepository->findByUid(3); self::assertSame($updatedBlogOne->getAdministrator()->getUid(), $blogTwo->getAdministrator()->getUid()); } } diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/LazyLoadingProxyTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/LazyLoadingProxyTest.php index d811ed561061..53563db76e2d 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/LazyLoadingProxyTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/LazyLoadingProxyTest.php @@ -18,9 +18,7 @@ namespace TYPO3\CMS\Extbase\Tests\Functional\Persistence; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; -use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy; use TYPO3\CMS\Extbase\Reflection\ObjectAccess; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -32,21 +30,10 @@ final class LazyLoadingProxyTest extends FunctionalTestCase protected array $coreExtensionsToLoad = ['extbase']; protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - /** - * Sets up this test suite. - */ protected function setUp(): void { parent::setUp(); - - GeneralUtility::makeInstance(ConnectionPool::class) - ->getConnectionForTable('fe_users') - ->insert('fe_users', [ - 'uid' => 1, - 'username' => 'Blog Admin', - 'tx_extbase_type' => Administrator::class, - ]); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/LazyLoadingProxyTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -80,7 +67,6 @@ public function serializeAndUnserialize(): void public function nonExistingLazyLoadedPropertyReturnsNull(): void { $lazyLoadingProxy = new LazyLoadingProxy(new Blog(), 'administrator', 0); - self::assertNull(ObjectAccess::getProperty($lazyLoadingProxy, 'name')); } } diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/LazyObjectStorageTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/LazyObjectStorageTest.php index c23f91120c1a..7754055ad71a 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/LazyObjectStorageTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/LazyObjectStorageTest.php @@ -27,18 +27,15 @@ final class LazyObjectStorageTest extends FunctionalTestCase { protected array $coreExtensionsToLoad = ['extbase']; - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - /** - * Sets up this test suite. - */ + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; + protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/LazyObjectStorageTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/OperatorTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/OperatorTest.php index 78d79c77bb2e..0b0ed1019513 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/OperatorTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/OperatorTest.php @@ -21,29 +21,18 @@ use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; -use TYPO3Tests\BlogExample\Domain\Repository\BlogRepository; use TYPO3Tests\BlogExample\Domain\Repository\PostRepository; final class OperatorTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - - protected BlogRepository $blogRepository; - protected PostRepository $postRepository; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - - $this->blogRepository = $this->get(BlogRepository::class); - $this->postRepository = $this->get(PostRepository::class); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/OperatorTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -53,12 +42,10 @@ protected function setUp(): void */ public function equalsNullIsResolvedCorrectly(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->equals('title', null) ); - self::assertSame(0, $query->count()); } @@ -67,12 +54,10 @@ public function equalsNullIsResolvedCorrectly(): void */ public function equalsCorrectlyHandlesCaseSensitivity(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->equals('title', 'PoSt1', false) ); - self::assertSame(2, $query->count()); } @@ -81,13 +66,11 @@ public function equalsCorrectlyHandlesCaseSensitivity(): void */ public function betweenSetsBoundariesCorrectly(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]); - $query->matching( $query->between('uid', 3, 5) ); - $result = array_map( static fn (array $row): int => $row['uid'], $query->execute(true) diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataTest.php index d71133aaadcb..999511ec6480 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/QueryLocalizedDataTest.php @@ -37,15 +37,13 @@ final class QueryLocalizedDataTest extends FunctionalTestCase { protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - protected PostRepository $postRepository; - protected PersistenceManager $persistenceManager; + private PostRepository $postRepository; + private PersistenceManager $persistenceManager; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/translatedBlogExampleData.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/QueryLocalizedDataTestImport.csv'); $configuration = [ 'persistence' => [ 'storagePid' => 20, @@ -57,7 +55,6 @@ protected function setUp(): void $configurationManager->setConfiguration($configuration); $this->postRepository = $this->get(PostRepository::class); $this->persistenceManager = $this->get(PersistenceManager::class); - $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -1077,10 +1074,9 @@ public function postsWithoutRespectingSysLanguage(int $languageUid, string $over /** * Compares array of domain objects with array containing properties values * - * @param array $objects * @param array $expected array of expected property values [ ['property' => 'value'], ['property' => 'value2']] */ - protected function assertObjectsProperties($objects, $expected): void + private function assertObjectsProperties(array $objects, array $expected): void { $actual = []; foreach ($objects as $key => $post) { @@ -1100,11 +1096,9 @@ protected function assertObjectsProperties($objects, $expected): void * to access protected properties, and iterator_to_array added. * * @param mixed $subject Object or array to get the property path from - * @param string $propertyPath - * * @return mixed Value of the property */ - protected static function getPropertyPath($subject, $propertyPath) + private static function getPropertyPath(mixed $subject, string $propertyPath): mixed { $propertyPathSegments = explode('.', $propertyPath); try { @@ -1114,7 +1108,7 @@ protected static function getPropertyPath($subject, $propertyPath) $subject = iterator_to_array(clone $subject, false); } } - } catch (PropertyNotAccessibleException $error) { + } catch (PropertyNotAccessibleException) { // Workaround for this test $propertyReflection = new \ReflectionProperty($subject, $pathSegment); return $propertyReflection->getValue($subject); diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/QueryParserTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/QueryParserTest.php index 07cd712f3904..1574e3b22949 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/QueryParserTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/QueryParserTest.php @@ -27,23 +27,14 @@ final class QueryParserTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/categories.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/persons.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/category-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/fe_users.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/fe_groups.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/QueryParserTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; } @@ -53,8 +44,7 @@ protected function setUp(): void */ public function queryWithMultipleRelationsToIdenticalTablesReturnsExpectedResultForOrQuery(): void { - $postRepository = $this->get(PostRepository::class); - $query = $postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->logicalAnd( $query->equals('blog', 3), @@ -64,9 +54,7 @@ public function queryWithMultipleRelationsToIdenticalTablesReturnsExpectedResult ) ) ); - - $result = $query->execute()->toArray(); - self::assertCount(3, $result); + self::assertCount(3, $query->execute()->toArray()); } /** @@ -76,13 +64,11 @@ public function queryWithMultipleRelationsToIdenticalTablesReturnsExpectedResult */ public function queryWithRelationHasAndBelongsToManyReturnsExpectedResult(): void { - $postRepository = $this->get(PostRepository::class); - $query = $postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->equals('tags.name', 'Tag12') ); - $result = $query->execute()->toArray(); - self::assertCount(2, $result); + self::assertCount(2, $query->execute()->toArray()); } /** @@ -92,14 +78,11 @@ public function queryWithRelationHasAndBelongsToManyReturnsExpectedResult(): voi */ public function queryWithRelationHasManyWithoutParentKeyFieldNameReturnsExpectedResult(): void { - $administratorRepository = $this->get(AdministratorRepository::class); - $query = $administratorRepository->createQuery(); + $query = $this->get(AdministratorRepository::class)->createQuery(); $query->matching( $query->equals('usergroup.title', 'Group A') ); - - $result = $query->execute()->toArray(); - self::assertCount(2, $result); + self::assertCount(2, $query->execute()->toArray()); } /** @@ -109,14 +92,12 @@ public function queryWithRelationHasManyWithoutParentKeyFieldNameReturnsExpected */ public function queryWithRelationHasOneAndHasAndBelongsToManyWithoutParentKeyFieldNameReturnsExpectedResult(): void { - $postRepository = $this->get(PostRepository::class); - $query = $postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->equals('author.firstname', 'Author') ); - $result = $query->execute()->toArray(); // there are 16 post in total, 2 without author, 1 hidden, 1 deleted => 12 posts - self::assertCount(12, $result); + self::assertCount(12, $query->execute()->toArray()); } /** @@ -124,16 +105,14 @@ public function queryWithRelationHasOneAndHasAndBelongsToManyWithoutParentKeyFie */ public function orReturnsExpectedResult(): void { - $postRepository = $this->get(PostRepository::class); - $query = $postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->logicalOr( $query->equals('tags.name', 'Tag12'), $query->equals('tags.name', 'Tag11') ) ); - $result = $query->execute()->toArray(); - self::assertCount(2, $result); + self::assertCount(2, $query->execute()->toArray()); } /** @@ -141,8 +120,7 @@ public function orReturnsExpectedResult(): void */ public function queryWithMultipleRelationsToIdenticalTablesReturnsExpectedResultForAndQuery(): void { - $postRepository = $this->get(PostRepository::class); - $query = $postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $query->matching( $query->logicalAnd( $query->equals('blog', 3), @@ -150,8 +128,7 @@ public function queryWithMultipleRelationsToIdenticalTablesReturnsExpectedResult $query->equals('author.tags.name', 'TagForAuthor1') ) ); - $result = $query->execute()->toArray(); - self::assertCount(1, $result); + self::assertCount(1, $query->execute()->toArray()); } /** @@ -159,12 +136,8 @@ public function queryWithMultipleRelationsToIdenticalTablesReturnsExpectedResult */ public function queryWithFindInSetReturnsExpectedResult(): void { - $administratorRepository = $this->get(AdministratorRepository::class); - $query = $administratorRepository->createQuery(); - - $result = $query->matching($query->contains('usergroup', 1)) - ->execute(); - self::assertCount(2, $result); + $query = $this->get(AdministratorRepository::class)->createQuery(); + self::assertCount(2, $query->matching($query->contains('usergroup', 1))->execute()); } /** @@ -172,8 +145,7 @@ public function queryWithFindInSetReturnsExpectedResult(): void */ public function queryForPostWithCategoriesReturnsPostWithCategories(): void { - $postRepository = $this->get(PostRepository::class); - $query = $postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $post = $query->matching($query->equals('uid', 1))->execute()->current(); self::assertCount(3, $post->getCategories()); } @@ -183,8 +155,7 @@ public function queryForPostWithCategoriesReturnsPostWithCategories(): void */ public function queryForBlogsAndPostsWithNoPostsShowsBlogRecord(): void { - $blogRepository = $this->get(BlogRepository::class); - $query = $blogRepository->createQuery(); + $query = $this->get(BlogRepository::class)->createQuery(); /** @var Blog $blog */ $blog = $query->matching($query->logicalOr( $query->like('description', '%w/o%'), diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/RelationTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/RelationTest.php index b79ba8febce2..651b95b91916 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/RelationTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/RelationTest.php @@ -21,8 +21,6 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; -use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction; use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; @@ -39,31 +37,21 @@ final class RelationTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; - protected Blog $blog; - protected PersistenceManager $persistenceManager; + private Blog $blog; + private PersistenceManager $persistenceManager; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/persons.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/categories.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/category-mm.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/RelationTestImport.csv'); $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); $GLOBALS['TYPO3_REQUEST'] = $request; - $this->persistenceManager = $this->get(PersistenceManager::class); $this->blog = $this->get(BlogRepository::class)->findByUid(1); - $GLOBALS['BE_USER'] = new BackendUserAuthentication(); $GLOBALS['BE_USER']->workspace = 0; } @@ -75,55 +63,14 @@ protected function setUp(): void */ public function attachPostToBlogAtTheEnd(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_post'); - $queryBuilder->getRestrictions()->removeAll()->add(new WorkspaceRestriction(0)); - $countPostsOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->executeQuery() - ->fetchOne(); - $newPostTitle = 'sdufhisdhuf'; $newPost = new Post(); $newPost->setBlog($this->blog); $newPost->setTitle($newPostTitle); $newPost->setContent('Bla Bla Bla'); - $this->blog->addPost($newPost); $this->updateAndPersistBlog(); - - $queryBuilder->resetQueryParts(); - $countPosts = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->executeQuery() - ->fetchOne(); - self::assertEquals($countPostsOriginal + 1, $countPosts); - - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertSame($newPostTitle, $post['title']); - self::assertEquals($countPostsOriginal + 1, $post['sorting']); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultAttachPostToBlogAtTheEnd.csv'); } /** @@ -133,74 +80,13 @@ public function attachPostToBlogAtTheEnd(): void */ public function removeLastPostFromBlog(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_post'); - $queryBuilder->getRestrictions() - ->removeAll()->add(new DeletedRestriction()); - $countPostsOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals(10, $post['sorting']); - $posts = $this->blog->getPosts(); $postsArray = $posts->toArray(); $latestPost = array_pop($postsArray); - self::assertEquals(10, $latestPost->getUid()); - $this->blog->removePost($latestPost); $this->updateAndPersistBlog(); - - $queryBuilder->resetQueryParts(); - $countPosts = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - self::assertEquals($countPostsOriginal - 1, $countPosts); - - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'uid', - $queryBuilder->createNamedParameter($latestPost->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertNull($post['uid'] ?? null); - - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertSame('Post9', $post['title']); - self::assertEquals(9, $post['sorting']); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultRemoveLastPostFromBlog.csv'); } /** @@ -210,17 +96,7 @@ public function removeLastPostFromBlog(): void */ public function addPostToBlogInTheMiddle(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_post'); - $queryBuilder->getRestrictions() - ->removeAll()->add(new DeletedRestriction()); - $countPostsOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - $newPost = new Post(); - $posts = clone $this->blog->getPosts(); $this->blog->getPosts()->removeAll($posts); $counter = 1; @@ -236,46 +112,7 @@ public function addPostToBlogInTheMiddle(): void $counter++; } $this->updateAndPersistBlog(); - - $queryBuilder->resetQueryParts(); - $countPosts = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - self::assertEquals($countPostsOriginal + 1, $countPosts); - - //last post - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertSame('Post10', $post['title']); - self::assertEquals(11, $post['sorting']); - - // check sorting of the post added in the middle - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'uid', - $queryBuilder->createNamedParameter($newPost->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertSame($newPostTitle, $post['title']); - self::assertEquals(6, $post['sorting']); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultAddPostToBlogInTheMiddle.csv'); } /** @@ -285,15 +122,6 @@ public function addPostToBlogInTheMiddle(): void */ public function removeMiddlePostFromBlog(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_post'); - $queryBuilder->getRestrictions() - ->removeAll()->add(new DeletedRestriction()); - $countPostsOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - $posts = clone $this->blog->getPosts(); $counter = 1; foreach ($posts as $post) { @@ -303,29 +131,7 @@ public function removeMiddlePostFromBlog(): void $counter++; } $this->updateAndPersistBlog(); - - $queryBuilder->resetQueryParts(); - $countPosts = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - self::assertEquals($countPostsOriginal - 1, $countPosts); - - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertSame('Post10', $post['title']); - self::assertEquals(10, $post['sorting']); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultRemoveMiddlePostFromBlog.csv'); } /** @@ -335,15 +141,6 @@ public function removeMiddlePostFromBlog(): void */ public function movePostFromEndToTheMiddle(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_post'); - $queryBuilder->getRestrictions() - ->removeAll()->add(new DeletedRestriction()); - $countPostsOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - $posts = clone $this->blog->getPosts(); $postsArray = $posts->toArray(); $latestPost = array_pop($postsArray); @@ -362,47 +159,7 @@ public function movePostFromEndToTheMiddle(): void $counter++; } $this->updateAndPersistBlog(); - - $queryBuilder->resetQueryParts(); - $countPosts = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_post') - ->executeQuery() - ->fetchOne(); - self::assertEquals($countPostsOriginal, $countPosts); - - $queryBuilder->getRestrictions()->removeAll(); - $post = $queryBuilder - ->select('title', 'sorting') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertSame('Post9', $post['title']); - self::assertEquals(10, $post['sorting']); - - $queryBuilder->resetQueryParts(); - $post = $queryBuilder - ->select('title', 'uid') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->and( - $queryBuilder->expr()->eq( - 'blog', - $queryBuilder->createNamedParameter($this->blog->getUid(), Connection::PARAM_INT) - ), - $queryBuilder->expr()->eq('sorting', $queryBuilder->createNamedParameter(6, Connection::PARAM_INT)) - ) - ) - ->executeQuery() - ->fetchAssociative(); - self::assertSame('MOVED POST Post10', $post['title']); - self::assertEquals(10, $post['uid']); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultMovePostFromEndToTheMiddle.csv'); } /** @@ -412,49 +169,14 @@ public function movePostFromEndToTheMiddle(): void */ public function attachTagToPostAtTheEnd(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_tag'); - $queryBuilder->getRestrictions() - ->removeAll(); - $countOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_tag') - ->executeQuery() - ->fetchOne(); - $newTagTitle = 'sdufhisdhuf'; - $newTag = new Tag($newTagTitle); - $postRepository = $this->get(PostRepository::class); $post = $postRepository->findByUid(1); $post->addTag($newTag); - $postRepository->update($post); $this->persistenceManager->persistAll(); - - $queryBuilder->resetQueryParts(); - $count = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_tag') - ->executeQuery() - ->fetchOne(); - self::assertEquals($countOriginal + 1, $count); - - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_post_tag_mm'); - $queryBuilder->getRestrictions() - ->removeAll(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals($newTag->getUid(), $tag['uid_foreign']); + self::assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultAttachTagToPostAtTheEnd.csv'); } /** @@ -464,15 +186,6 @@ public function attachTagToPostAtTheEnd(): void */ public function removeLastTagFromPost(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_tag'); - $queryBuilder->getRestrictions() - ->removeAll()->add(new DeletedRestriction()); - $countOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_tag') - ->executeQuery() - ->fetchOne(); - $postRepository = $this->get(PostRepository::class); $post = $postRepository->findByUid(1); $tags = $post->getTags(); @@ -486,49 +199,7 @@ public function removeLastTagFromPost(): void $postRepository->update($post); $this->persistenceManager->persistAll(); - $queryBuilder->resetQueryParts(); - $countTags = $queryBuilder - ->count('*') - ->from('tx_blogexample_domain_model_tag') - ->executeQuery() - ->fetchOne(); - self::assertEquals($countOriginal, $countTags); - - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_post_tag_mm'); - $queryBuilder->getRestrictions() - ->removeAll(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals(9, $tag['uid_foreign']); - - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->and( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ), - $queryBuilder->expr()->eq( - 'uid_foreign', - $queryBuilder->createNamedParameter($latestTag->getUid(), Connection::PARAM_INT) - ) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertNull($tag['uid_foreign'] ?? null); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultRemoveLastTagFromPost.csv'); } /** @@ -538,18 +209,6 @@ public function removeLastTagFromPost(): void */ public function addTagToPostInTheMiddle(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_post_tag_mm'); - $queryBuilder->getRestrictions() - ->removeAll(); - $countTagsOriginal = $queryBuilder - ->count('*') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchOne(); - $postRepository = $this->get(PostRepository::class); $post = $postRepository->findByUid(1); $tags = clone $post->getTags(); @@ -568,48 +227,7 @@ public function addTagToPostInTheMiddle(): void $postRepository->update($post); $this->persistenceManager->persistAll(); - - $queryBuilder->resetQueryParts(); - $countTags = $queryBuilder - ->count('*') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchOne(); - self::assertEquals($countTagsOriginal + 1, $countTags); - - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals(10, $tag['uid_foreign']); - - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->and( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ), - $queryBuilder->expr()->eq('sorting', $queryBuilder->createNamedParameter(6, Connection::PARAM_INT)) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals($newTag->getUid(), $tag['uid_foreign']); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultAddTagToPostInTheMiddle.csv'); } /** @@ -619,19 +237,6 @@ public function addTagToPostInTheMiddle(): void */ public function removeMiddleTagFromPost(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_post_tag_mm'); - $queryBuilder->getRestrictions() - ->removeAll(); - $countTags = $queryBuilder - ->count('*') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchOne(); - self::assertEquals(10, $countTags); - $postRepository = $this->get(PostRepository::class); $post = $postRepository->findByUid(1); $tags = clone $post->getTags(); @@ -645,49 +250,7 @@ public function removeMiddleTagFromPost(): void $postRepository->update($post); $this->persistenceManager->persistAll(); - - $queryBuilder->resetQueryParts(); - $countTags = $queryBuilder - ->count('*') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchOne(); - self::assertEquals(9, $countTags); - - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign', 'sorting') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals(10, $tag['uid_foreign']); - self::assertEquals(10, $tag['sorting']); - - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->and( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ), - $queryBuilder->expr()->eq('sorting', $queryBuilder->createNamedParameter(5, Connection::PARAM_INT)) - ) - ) - ->executeQuery() - ->fetchAssociative(); - self::assertNull($tag['uid_foreign'] ?? null); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultRemoveMiddleTagFromPost.csv'); } /** @@ -697,19 +260,6 @@ public function removeMiddleTagFromPost(): void */ public function moveTagFromEndToTheMiddle(): void { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_post_tag_mm'); - $queryBuilder->getRestrictions() - ->removeAll(); - $countTags = $queryBuilder - ->count('*') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchOne(); - self::assertEquals(10, $countTags); - $postRepository = $this->get(PostRepository::class); $post = $postRepository->findByUid(1); $tags = clone $post->getTags(); @@ -733,103 +283,7 @@ public function moveTagFromEndToTheMiddle(): void $postRepository->update($post); $this->persistenceManager->persistAll(); - - $queryBuilder->resetQueryParts(); - $countTags = $queryBuilder - ->count('*') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchOne(); - self::assertEquals(10, $countTags); - - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign', 'sorting') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ) - )->orderBy('sorting', 'DESC') - ->executeQuery() - ->fetchAssociative(); - self::assertEquals(9, $tag['uid_foreign']); - self::assertEquals(10, $tag['sorting']); - - $sorting = '6'; - $queryBuilder->resetQueryParts(); - $tag = $queryBuilder - ->select('uid_foreign') - ->from('tx_blogexample_post_tag_mm') - ->where( - $queryBuilder->expr()->and( - $queryBuilder->expr()->eq( - 'uid_local', - $queryBuilder->createNamedParameter($post->getUid(), Connection::PARAM_INT) - ), - $queryBuilder->expr()->eq( - 'sorting', - $queryBuilder->createNamedParameter($sorting) - ) - ) - ) - ->executeQuery() - ->fetchAssociative(); - self::assertEquals(10, $tag['uid_foreign']); - } - - /** - * Test if timestamp field is updated when updating a record - * - * @test - */ - public function timestampFieldIsUpdatedOnPostSave(): void - { - $queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tx_blogexample_domain_model_post'); - $queryBuilder->getRestrictions() - ->removeAll(); - $rawPost = $queryBuilder - ->select('*') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchAssociative(); - - $postRepository = $this->get(PostRepository::class); - $post = $postRepository->findByUid(1); - $post->setTitle('newTitle'); - - $postRepository->update($post); - $this->persistenceManager->persistAll(); - - $queryBuilder->resetQueryParts(); - $rawPost2 = $queryBuilder - ->select('*') - ->from('tx_blogexample_domain_model_post') - ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)) - ) - ->executeQuery() - ->fetchAssociative(); - self::assertTrue($rawPost2['tstamp'] > $rawPost['tstamp']); - } - - /** - * Test query matching for mm relation without MM_match_fields defined - * - * @test - */ - public function mmRelationWithoutMatchFieldIsResolved(): void - { - $postRepository = $this->get(PostRepository::class); - $posts = $postRepository->findByTagAndBlog('Tag2', $this->blog); - self::assertCount(1, $posts); + $this->assertCSVDataSet(__DIR__ . '/Fixtures/RelationTestResultMoveTagFromEndToTheMiddle.csv'); } /** @@ -1058,7 +512,7 @@ public static function distinctDataProvider(): array ]; } - protected function applyQueryRequest(QueryInterface $query, array $queryRequest): void + private function applyQueryRequest(QueryInterface $query, array $queryRequest): void { if (isset($queryRequest['order']) && !$queryRequest['order']) { $query->setOrderings([]); @@ -1106,7 +560,7 @@ public function distinctPersonRecordsAreFoundByPublisher(array $queryRequest): v $this->assertDistinctIds($postIds); } - protected function provideFindPostsByPublisherQuery(int $publisherId): QueryInterface + private function provideFindPostsByPublisherQuery(int $publisherId): QueryInterface { $postRepository = $this->get(PostRepository::class); $query = $postRepository->createQuery(); @@ -1156,7 +610,7 @@ public function distinctBlogRecordsAreFoundByPostsSince(array $queryRequest): vo $this->assertDistinctIds($blogIds); } - protected function provideFindBlogsByPostsSinceQuery(\DateTime $date): QueryInterface + private function provideFindBlogsByPostsSinceQuery(\DateTime $date): QueryInterface { $blogRepository = $this->get(BlogRepository::class); $query = $blogRepository->createQuery(); @@ -1199,7 +653,7 @@ public function distinctPersonRecordsAreFoundByTagNameAreFiltered(array $queryRe $this->assertDistinctIds($personIds); } - protected function provideFindPersonsByTagNameQuery(string $tagName): QueryInterface + private function provideFindPersonsByTagNameQuery(string $tagName): QueryInterface { $personRepository = $this->get(PersonRepository::class); $query = $personRepository->createQuery(); @@ -1245,7 +699,7 @@ public function distinctPostRecordsAreFoundByAuthorTagNameAreFiltered(array $que $this->assertDistinctIds($postsIds); } - protected function provideFindPostsByAuthorTagName(string $tagName): QueryInterface + private function provideFindPostsByAuthorTagName(string $tagName): QueryInterface { $postRepository = $this->get(PostRepository::class); $query = $postRepository->createQuery(); @@ -1261,7 +715,7 @@ protected function provideFindPostsByAuthorTagName(string $tagName): QueryInterf /** * Helper method for persisting blog */ - protected function updateAndPersistBlog(): void + private function updateAndPersistBlog(): void { $blogRepository = $this->get(BlogRepository::class); $blogRepository->update($this->blog); @@ -1272,7 +726,7 @@ protected function updateAndPersistBlog(): void * @param AbstractEntity[] $entities * @return int[] */ - protected function resolveEntityIds(array $entities): array + private function resolveEntityIds(array $entities): array { return array_map( static fn (AbstractEntity $entity): int => $entity->getUid(), @@ -1283,7 +737,7 @@ protected function resolveEntityIds(array $entities): array /** * @return int[] */ - protected function resolveRecordIds(array $records): array + private function resolveRecordIds(array $records): array { return array_column($records, 'uid'); } @@ -1291,7 +745,7 @@ protected function resolveRecordIds(array $records): array /** * Counts amount of distinct IDS. */ - protected function countDistinctIds(array $ids): int + private function countDistinctIds(array $ids): int { return count(array_unique($ids)); } @@ -1300,7 +754,7 @@ protected function countDistinctIds(array $ids): int * Asserts distinct IDs by comparing the sum of the occurrence of * a particular ID to the amount of existing distinct IDs. */ - protected function assertDistinctIds(array $ids): void + private function assertDistinctIds(array $ids): void { $counts = array_count_values($ids); self::assertEquals(count($counts), array_sum($counts)); diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/RepositoryTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/RepositoryTest.php index d3324c4c224f..02c3d726a1c5 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/RepositoryTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/RepositoryTest.php @@ -24,22 +24,14 @@ final class RepositoryTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - - protected PostRepository $postRepository; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected function setUp(): void { parent::setUp(); - - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/persons.csv'); - - $this->postRepository = $this->get(PostRepository::class); + $this->importCSVDataSet(__DIR__ . '/Fixtures/RepositoryTestImport.csv'); } public static function findByRespectsSingleCriteriaDataProvider(): \Generator @@ -48,12 +40,10 @@ public static function findByRespectsSingleCriteriaDataProvider(): \Generator ['blog' => 1], 10, ]; - yield 'findBy(["blog" => 1]) => 1' => [ ['blog' => 2], 1, ]; - yield 'findBy(["blog" => 1]) => 3' => [ ['blog' => 3], 3, @@ -66,7 +56,7 @@ public static function findByRespectsSingleCriteriaDataProvider(): \Generator */ public function findByRespectsSingleCriteria(array $criteria, int $expectedCount): void { - self::assertCount($expectedCount, $this->postRepository->findBy($criteria)); + self::assertCount($expectedCount, $this->get(PostRepository::class)->findBy($criteria)); } /** @@ -74,7 +64,7 @@ public function findByRespectsSingleCriteria(array $criteria, int $expectedCount */ public function findByRespectsMultipleCriteria(): void { - self::assertCount(6, $this->postRepository->findBy(['blog' => 1, 'author' => 1])); + self::assertCount(6, $this->get(PostRepository::class)->findBy(['blog' => 1, 'author' => 1])); } /** @@ -82,16 +72,14 @@ public function findByRespectsMultipleCriteria(): void */ public function findByRespectsSingleOrderBy(): void { - $posts = $this->postRepository->findBy( + $posts = $this->get(PostRepository::class)->findBy( ['blog' => 1, 'author' => 1], ['title' => QueryInterface::ORDER_DESCENDING] )->toArray(); - $titles = array_map( static fn (Post $post): string => $post->getTitle(), $posts ); - self::assertSame([ 'Post9', 'Post8', @@ -107,11 +95,10 @@ public function findByRespectsSingleOrderBy(): void */ public function findByRespectsMultipleOrderBy(): void { - $posts = $this->postRepository->findBy( + $posts = $this->get(PostRepository::class)->findBy( [], ['blog.uid' => QueryInterface::ORDER_ASCENDING, 'title' => QueryInterface::ORDER_DESCENDING] )->toArray(); - self::assertSame( [ [ @@ -183,17 +170,15 @@ public function findByRespectsMultipleOrderBy(): void */ public function findByRespectsLimit(): void { - $posts = $this->postRepository->findBy( + $posts = $this->get(PostRepository::class)->findBy( ['author' => 1], ['uid' => QueryInterface::ORDER_DESCENDING], 3 )->toArray(); - $titles = array_map( static fn (Post $post): array => ['uid' => $post->getUid(), 'title' => $post->getTitle()], $posts ); - self::assertSame([ [ 'uid' => 14, @@ -215,18 +200,16 @@ public function findByRespectsLimit(): void */ public function findByRespectsOffset(): void { - $posts = $this->postRepository->findBy( + $posts = $this->get(PostRepository::class)->findBy( ['author' => 1], ['uid' => QueryInterface::ORDER_DESCENDING], 3, 1 )->toArray(); - $titles = array_map( static fn (Post $post): array => ['uid' => $post->getUid(), 'title' => $post->getTitle()], $posts ); - self::assertSame([ [ 'uid' => 13, @@ -249,7 +232,6 @@ public static function findOneByRespectsSingleCriteriaDataProvider(): \Generator ['uid' => 1], 1, ]; - yield 'findOneBy(["blog" => 100]) => null' => [ ['uid' => 100], null, @@ -263,8 +245,7 @@ public static function findOneByRespectsSingleCriteriaDataProvider(): \Generator public function findOneByRespectsSingleCriteria(array $criteria, int|null $expectedUid): void { /** @var Post|null $post */ - $post = $this->postRepository->findOneBy($criteria); - + $post = $this->get(PostRepository::class)->findOneBy($criteria); self::assertSame($expectedUid, $post?->getUid()); } @@ -274,8 +255,7 @@ public function findOneByRespectsSingleCriteria(array $criteria, int|null $expec */ public function findOneByRespectsMultipleCriteria(): void { - $post = $this->postRepository->findOneBy(['blog' => 1, 'author' => 1]); - + $post = $this->get(PostRepository::class)->findOneBy(['blog' => 1, 'author' => 1]); self::assertSame('Post4', $post?->getTitle()); } @@ -284,11 +264,10 @@ public function findOneByRespectsMultipleCriteria(): void */ public function findOneByRespectsOrderBy(): void { - $post = $this->postRepository->findOneBy( + $post = $this->get(PostRepository::class)->findOneBy( ['blog' => 1, 'author' => 1], ['title' => QueryInterface::ORDER_DESCENDING] ); - self::assertSame('Post9', $post?->getTitle()); } @@ -299,7 +278,7 @@ public function countRespectsSingleCriteria(): void { self::assertSame( 10, - $this->postRepository->count( + $this->get(PostRepository::class)->count( ['blog' => 1], ) ); @@ -312,7 +291,7 @@ public function countRespectsMultipleCriteria(): void { self::assertSame( 1, - $this->postRepository->count( + $this->get(PostRepository::class)->count( ['blog' => 1, 'author' => 3], ) ); diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedSiteContentTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedSiteContentTest.php index e6ba5a606839..6f4fb45471e5 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedSiteContentTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/TranslatedSiteContentTest.php @@ -37,7 +37,9 @@ final class TranslatedSiteContentTest extends AbstractDataHandlerActionTestCase protected const TABLE_Content = 'tt_content'; protected const TABLE_Pages = 'pages'; - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected array $pathsToLinkInTestInstance = [ 'typo3/sysext/frontend/Tests/Functional/Fixtures/Images' => 'fileadmin/user_upload', @@ -58,10 +60,8 @@ final class TranslatedSiteContentTest extends AbstractDataHandlerActionTestCase protected function setUp(): void { parent::setUp(); - // @todo: Copy those files to local directory - $this->importCSVDataSet(__DIR__ . '/../../../../frontend/Tests/Functional/Rendering/DataSet/LiveDefaultPages.csv'); - $this->importCSVDataSet(__DIR__ . '/../../../../frontend/Tests/Functional/Rendering/DataSet/LiveDefaultElements.csv'); - + $this->importCSVDataSet(__DIR__ . '/Fixtures/DataSet/LiveDefaultPages.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/DataSet/LiveDefaultElements.csv'); $this->contentRepository = $this->get(TtContentRepository::class); $this->setUpFrontendRootPage(1, [ 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TypoScript/setup.typoscript', diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php index 6f2d94b9c2b9..5182e0e16c8f 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php @@ -34,64 +34,35 @@ final class TranslationTest extends FunctionalTestCase { - protected array $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example']; - - protected PostRepository $postRepository; + protected array $testExtensionsToLoad = [ + 'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example', + ]; protected function setUp(): void { parent::setUp(); - /* - * Posts Dataset for the tests: - * - * Post1 - * -> EN: Post1 - * -> GR: Post1 - * Post2 - * -> EN: Post2 - * Post3 - * Post10 [hidden] - * -> GR: Post10 [hidden] - */ - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/translated-posts.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/post-tag-mm.csv'); - $this->importCSVDataSet(__DIR__ . '/../Persistence/Fixtures/tags.csv'); - - $this->setUpBasicFrontendEnvironment(); + $this->importCSVDataSet(__DIR__ . '/Fixtures/TranslationTestImport.csv'); - $this->postRepository = $this->get(PostRepository::class); - // ConfigurationManager is used by PersistenceManager to retrieve configuration. - // We set a proper extensionName and pluginName for the ConfigurationManager singleton - // here, to not run into warnings due to incomplete test setup. - $configurationManager = $this->get(ConfigurationManager::class); - $configurationManager->setConfiguration([ - 'extensionName' => 'blog_example', - 'pluginName' => 'test', - ]); - } - - /** - * Minimal frontend environment to satisfy Extbase Typo3DbBackend - */ - protected function setUpBasicFrontendEnvironment(): void - { - // in v9 overlay and language mode has different default values, so we need to set them here explicitly - // to match v8 behaviour $context = GeneralUtility::makeInstance(Context::class); $context->setAspect('language', new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_OFF)); - $frontendTypoScript = new FrontendTypoScript(new RootNode(), []); $frontendTypoScript->setSetupArray([]); $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest()) ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) ->withAttribute('frontend.typoscript', $frontendTypoScript); - - $pageRepositoryFixture = new PageRepository($context); + $pageRepository = new PageRepository($context); $frontendControllerMock = $this->createMock(TypoScriptFrontendController::class); - $frontendControllerMock->sys_page = $pageRepositoryFixture; + $frontendControllerMock->sys_page = $pageRepository; $GLOBALS['TSFE'] = $frontendControllerMock; + + // ConfigurationManager is used by PersistenceManager to retrieve configuration. + // We set a proper extensionName and pluginName for the ConfigurationManager singleton + // here, to not run into warnings due to incomplete test setup. + $configurationManager = $this->get(ConfigurationManager::class); + $configurationManager->setConfiguration([ + 'extensionName' => 'blog_example', + 'pluginName' => 'test', + ]); } /** @@ -101,8 +72,7 @@ protected function setUpBasicFrontendEnvironment(): void */ public function countReturnsCorrectNumberOfPosts(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); @@ -118,13 +88,11 @@ public function countReturnsCorrectNumberOfPosts(): void */ public function countReturnsCorrectNumberOfPostsInEnglishLanguage(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_OFF)); - $postCount = $query->execute()->count(); self::assertSame(2, $postCount); } @@ -134,15 +102,12 @@ public function countReturnsCorrectNumberOfPostsInEnglishLanguage(): void */ public function countReturnsCorrectNumberOfPostsInGreekLanguage(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_OFF)); - $postCount = $query->execute()->count(); - self::assertSame(2, $postCount); } @@ -151,18 +116,14 @@ public function countReturnsCorrectNumberOfPostsInGreekLanguage(): void */ public function fetchingPostsReturnsEnglishPostsWithFallback(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_ON)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - self::assertCount(2, $posts); self::assertSame('A EN:Post2', $posts[0]->getTitle()); self::assertSame('B EN:Post1', $posts[1]->getTitle()); @@ -173,16 +134,14 @@ public function fetchingPostsReturnsEnglishPostsWithFallback(): void */ public function fetchingPostsByInClauseReturnsDefaultPostsWithFallback(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(false); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_MIXED)); - $query->matching($query->in('uid', [4])); /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - self::assertCount(1, $posts); self::assertSame('Post2', $posts[0]->getTitle()); } @@ -194,18 +153,14 @@ public function fetchingPostsByInClauseReturnsDefaultPostsWithFallback(): void */ public function fetchingPostsReturnsGreekPostsWithFallback(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - self::assertCount(2, $posts); self::assertSame('GR:Post1', $posts[0]->getTitle()); self::assertSame('GR:Post11', $posts[1]->getTitle()); @@ -218,18 +173,14 @@ public function fetchingPostsReturnsGreekPostsWithFallback(): void */ public function fetchingPostsReturnsGreekPostsWithHideNonTranslated(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_ON)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - self::assertCount(2, $posts); self::assertSame('GR:Post1', $posts[0]->getTitle()); self::assertSame('GR:Post11', $posts[1]->getTitle()); @@ -255,16 +206,14 @@ public static function fetchingTranslatedPostByUidDataProvider(): array */ public function fetchingTranslatedPostByInClauseWithStrictLanguageSettings(array $input, array $expectedTitles): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_ON)); - $query->matching($query->in('uid', $input)); /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - // @todo: wrong assertion // We're simulating a strict language configuration where a blog post (uid=12 or uid=1) has been translated to another // language. However, Extbase is not able to find the translated record via ->in() and therefore returns an @@ -280,22 +229,18 @@ public function fetchingTranslatedPostByInClauseWithStrictLanguageSettings(array */ public function fetchingTranslatedPostByEqualsUidClauseWithStrictLanguageSettings(array $input, array $expectedTitles): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_ON)); - $constraints = []; foreach ($input as $uid) { $constraints[] = $query->equals('uid', $uid); } - $query->matching($query->logicalOr(...$constraints)); - /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - // @todo: wrong assertion // We're simulating a strict language configuration where a blog post (uid=12 or uid=1) has been translated to another // language. However, Extbase is not able to find the translated record via ->equals(uid=12 OR uid=1 OR ...) and therefore returns an @@ -310,18 +255,14 @@ public function fetchingTranslatedPostByEqualsUidClauseWithStrictLanguageSetting */ public function orderingByTitleRespectsEnglishTitles(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - self::assertCount(2, $posts); self::assertSame('A EN:Post2', $posts[0]->getTitle()); self::assertSame('B EN:Post1', $posts[1]->getTitle()); @@ -335,21 +276,17 @@ public function orderingByTitleRespectsEnglishTitles(): void */ public function orderingByBlogTitle(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings([ 'blog.title' => QueryInterface::ORDER_ASCENDING, 'uid' => QueryInterface::ORDER_ASCENDING, ]); - /** @var Post[]|array $posts */ $posts = $query->execute()->toArray(); - self::assertCount(2, $posts); self::assertSame('B EN:Post1', $posts[0]->getTitle()); self::assertSame('A EN:Post2', $posts[1]->getTitle()); @@ -364,19 +301,16 @@ public function orderingByBlogTitle(): void */ public function fetchingHiddenPostsWithIgnoreEnableField(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setIgnoreEnableFields(true); $querySettings->setLanguageAspect(new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_ON)); - //we need it to have stable results on pgsql + // we need it to have stable results on pgsql $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[] $posts */ $posts = $query->execute()->toArray(); - self::assertCount(5, $posts); self::assertSame('Post10', $posts[3]->getTitle()); } @@ -389,8 +323,7 @@ public function fetchingHiddenPostsWithIgnoreEnableField(): void */ public function fetchingHiddenPostsReturnsHiddenOverlay(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); @@ -398,12 +331,9 @@ public function fetchingHiddenPostsReturnsHiddenOverlay(): void $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_OFF)); // We need it to have stable results on pgsql $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[] $posts */ $posts = $query->execute()->toArray(); - self::assertCount(3, $posts); - self::assertSame('GR:Post1', $posts[0]->getTitle()); self::assertSame('GR:Post10', $posts[1]->getTitle()); self::assertSame('GR:Post11', $posts[2]->getTitle()); @@ -420,8 +350,7 @@ public function fetchingHiddenPostsReturnsHiddenOverlay(): void */ public function fetchingHiddenPostsReturnsHiddenOverlayOverlayEnabled(): void { - $query = $this->postRepository->createQuery(); - + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); @@ -429,12 +358,9 @@ public function fetchingHiddenPostsReturnsHiddenOverlayOverlayEnabled(): void $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_MIXED)); //we need it to have stable results on pgsql $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]); - /** @var Post[] $posts */ $posts = $query->execute()->toArray(); - self::assertCount(5, $posts); - self::assertSame('GR:Post1', $posts[0]->getTitle()); self::assertSame('Post2', $posts[1]->getTitle()); self::assertSame('Post3', $posts[2]->getTitle()); @@ -450,12 +376,11 @@ public function fetchingHiddenPostsReturnsHiddenOverlayOverlayEnabled(): void */ public function fetchingTranslatedPostByTitle(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); $query->matching($query->equals('title', 'GR:Post1')); /** @var Post[]|array $posts */ @@ -472,12 +397,11 @@ public function fetchingTranslatedPostByTitle(): void */ public function fetchingTranslatedPostByBlogTitle(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([1]); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(2, 2, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); $query->matching($query->equals('blog.title', 'Blog1')); /** @var Post[]|array $posts */ @@ -492,12 +416,11 @@ public function fetchingTranslatedPostByBlogTitle(): void */ public function fetchingPostByTagName(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setRespectStoragePage(false); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(0, 0, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); $query->matching($query->equals('tags.name', 'Tag1')); /** @var Post[]|array $posts */ @@ -511,12 +434,11 @@ public function fetchingPostByTagName(): void */ public function fetchingTranslatedPostByTagName(): void { - $query = $this->postRepository->createQuery(); + $query = $this->get(PostRepository::class)->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setRespectStoragePage(false); $querySettings->setRespectSysLanguage(true); $querySettings->setLanguageAspect(new LanguageAspect(1, 1, LanguageAspect::OVERLAYS_OFF)); - $query->setOrderings(['title' => QueryInterface::ORDER_ASCENDING]); $query->matching($query->equals('tags.name', 'Tag1')); /** @var Post[]|array $posts */ diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php index b9a0a8015a5e..6b806ee2ef10 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php @@ -45,11 +45,65 @@ final class WorkspaceTest extends FunctionalTestCase protected function setUp(): void { parent::setUp(); - $this->importCSVDataSet(__DIR__ . '/../Fixtures/pages.csv'); - $this->importCsvDataSet(__DIR__ . '/../Persistence/Fixtures/blogs.csv'); - $this->importCsvDataSet(__DIR__ . '/../Persistence/Fixtures/posts.csv'); - $this->importCsvDataSet(__DIR__ . '/../Persistence/Fixtures/categories.csv'); - $this->importCsvDataSet(__DIR__ . '/../Persistence/Fixtures/category-mm.csv'); + $this->importCSVDataSet(__DIR__ . '/Fixtures/WorkspaceTestImport.csv'); + } + + /** + * Minimal frontend environment to satisfy Extbase Typo3DbBackend + */ + private function setupSubjectInFrontend(int $workspaceId = 1): void + { + $context = new Context( + [ + 'workspace' => new WorkspaceAspect($workspaceId), + ] + ); + GeneralUtility::setSingletonInstance(Context::class, $context); + $frontendTypoScript = new FrontendTypoScript(new RootNode(), []); + $frontendTypoScript->setSetupArray([]); + $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest()) + ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) + ->withAttribute('frontend.typoscript', $frontendTypoScript); + $this->blogRepository = $this->get(BlogRepository::class); + // ConfigurationManager is used by PersistenceManager to retrieve configuration. + // We set a proper extensionName and pluginName for the ConfigurationManager singleton + // here, to not run into warnings due to incomplete test setup. + $configurationManager = $this->get(ConfigurationManager::class); + $configurationManager->setConfiguration([ + 'extensionName' => 'blog_example', + 'pluginName' => 'test', + ]); + } + + /** + * Minimal backend user configuration to satisfy Extbase Typo3DbBackend + */ + private function setupSubjectInBackend(int $workspaceId = 1): void + { + $backendUser = new BackendUserAuthentication(); + $backendUser->workspace = $workspaceId; + $GLOBALS['BE_USER'] = $backendUser; + $context = new Context( + [ + 'backend.user' => new UserAspect($backendUser), + 'workspace' => new WorkspaceAspect($workspaceId), + ] + ); + GeneralUtility::setSingletonInstance(Context::class, $context); + $frontendTypoScript = new FrontendTypoScript(new RootNode(), []); + $frontendTypoScript->setSetupArray([]); + $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest()) + ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) + ->withAttribute('frontend.typoscript', $frontendTypoScript); + $this->blogRepository = $this->get(BlogRepository::class); + // ConfigurationManager is used by PersistenceManager to retrieve configuration. + // We set a proper extensionName and pluginName for the ConfigurationManager singleton + // here, to not run into warnings due to incomplete test setup. + $configurationManager = $this->get(ConfigurationManager::class); + $configurationManager->setConfiguration([ + 'extensionName' => 'blog_example', + 'pluginName' => 'test', + ]); } public static function contextDataProvider(): array @@ -77,10 +131,8 @@ public function countReturnsCorrectNumberOfBlogs(string $context): void } $query = $this->blogRepository->createQuery(); - $querySettings = $query->getQuerySettings(); $querySettings->setRespectStoragePage(false); - // In workspace all records need to be fetched, thus enableFields is ignored // This means we select even hidden (but not deleted) records for count() self::assertSame(6, $query->execute()->count()); @@ -100,7 +152,6 @@ public function fetchingHiddenBlogInWorkspace(string $context): void } $query = $this->blogRepository->createQuery(); - $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([0]); $query->matching( @@ -148,21 +199,15 @@ public function fetchingAllBlogsReturnsCorrectNumberOfBlogs(string $context): vo } $query = $this->blogRepository->createQuery(); - $querySettings = $query->getQuerySettings(); $querySettings->setRespectStoragePage(false); - $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]); - $blogs = $query->execute()->toArray(); - self::assertCount(4, $blogs); - // Check first blog was overlaid with workspace preview $firstBlog = array_shift($blogs); self::assertSame(1, $firstBlog->getUid()); self::assertSame('WorkspaceOverlay Blog1', $firstBlog->getTitle()); - // Check second-last blog was enabled in workspace preview array_pop($blogs); $lastBlog = array_pop($blogs); @@ -183,15 +228,11 @@ public function fetchingBlogReturnsOverlaidWorkspaceVersionForRelations(string $ } $query = $this->blogRepository->createQuery(); - $querySettings = $query->getQuerySettings(); $querySettings->setStoragePageIds([0]); - $query->matching($query->equals('uid', 1)); - $blog = $query->execute()->getFirst(); $posts = $blog->getPosts()->toArray(); - self::assertSame('WorkspaceOverlay Blog1', $blog->getTitle()); self::assertCount(10, (array)$posts); self::assertSame('WorkspaceOverlay Post1', $posts[0]->getTitle()); @@ -210,7 +251,6 @@ public function fetchingBlogReturnsManyToManyRelationsInLiveWorkspace(): void $querySettings = $query->getQuerySettings(); $querySettings->setRespectStoragePage(false); $query->matching($query->equals('uid', 1)); - /** @var Blog $blog */ $blog = $query->execute()->getFirst(); self::assertEquals('Blog1', $blog->getTitle()); @@ -222,73 +262,14 @@ public function fetchingBlogReturnsManyToManyRelationsInLiveWorkspace(): void */ public function fetchingBlogReturnsOverlaidWorkspaceVersionForManyToManyRelations(): void { - $this->setupSubjectInFrontend(1); + $this->setupSubjectInFrontend(); $query = $this->blogRepository->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setRespectStoragePage(false); $query->matching($query->equals('uid', 1)); - /** @var Blog $blog */ $blog = $query->execute()->getFirst(); self::assertEquals('WorkspaceOverlay Blog1', $blog->getTitle()); self::assertCount(2, $blog->getCategories()); } - - /** - * Minimal frontend environment to satisfy Extbase Typo3DbBackend - */ - protected function setupSubjectInFrontend(int $workspaceId = 1): void - { - $context = new Context( - [ - 'workspace' => new WorkspaceAspect($workspaceId), - ] - ); - GeneralUtility::setSingletonInstance(Context::class, $context); - $frontendTypoScript = new FrontendTypoScript(new RootNode(), []); - $frontendTypoScript->setSetupArray([]); - $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest()) - ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) - ->withAttribute('frontend.typoscript', $frontendTypoScript); - $this->blogRepository = $this->get(BlogRepository::class); - // ConfigurationManager is used by PersistenceManager to retrieve configuration. - // We set a proper extensionName and pluginName for the ConfigurationManager singleton - // here, to not run into warnings due to incomplete test setup. - $configurationManager = $this->get(ConfigurationManager::class); - $configurationManager->setConfiguration([ - 'extensionName' => 'blog_example', - 'pluginName' => 'test', - ]); - } - - /** - * Minimal backend user configuration to satisfy Extbase Typo3DbBackend - */ - protected function setupSubjectInBackend(int $workspaceId = 1): void - { - $backendUser = new BackendUserAuthentication(); - $backendUser->workspace = $workspaceId; - $GLOBALS['BE_USER'] = $backendUser; - $context = new Context( - [ - 'backend.user' => new UserAspect($backendUser), - 'workspace' => new WorkspaceAspect($workspaceId), - ] - ); - GeneralUtility::setSingletonInstance(Context::class, $context); - $frontendTypoScript = new FrontendTypoScript(new RootNode(), []); - $frontendTypoScript->setSetupArray([]); - $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest()) - ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) - ->withAttribute('frontend.typoscript', $frontendTypoScript); - $this->blogRepository = $this->get(BlogRepository::class); - // ConfigurationManager is used by PersistenceManager to retrieve configuration. - // We set a proper extensionName and pluginName for the ConfigurationManager singleton - // here, to not run into warnings due to incomplete test setup. - $configurationManager = $this->get(ConfigurationManager::class); - $configurationManager->setConfiguration([ - 'extensionName' => 'blog_example', - 'pluginName' => 'test', - ]); - } }