Loading tests/modules/translation_views_test_views/test_views/views.view.test_operations_links.yml +0 −12 Original line number Diff line number Diff line Loading @@ -213,18 +213,6 @@ display: operator_limit_selection: false operator_list: { } group: 1 type: id: type table: node_field_data field: type value: article: article entity_type: node entity_field: type plugin_id: bundle expose: operator_limit_selection: false operator_list: { } translation_target_language: id: translation_target_language table: node_translation Loading tests/src/Functional/CommentFullViewFiltersFieldsTest.php +27 −14 Original line number Diff line number Diff line Loading @@ -33,6 +33,11 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { private $viewPath = 'comment-translation'; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * Checks that text is in specific row. * Loading Loading @@ -90,7 +95,8 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { * Entity subcategory (e.g. Article). */ private function enableTranslation($category, $subcategory) { $this->drupalPostForm('admin/config/regional/content-language', [ $this->drupalGet('admin/config/regional/content-language'); $this->submitForm([ "entity_types[$category]" => 1, "settings[$category][$subcategory][translatable]" => 1, "settings[$category][$subcategory][settings][language][language_alterable]" => 1, Loading Loading @@ -127,8 +133,8 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { /** * {@inheritdoc} */ protected function setUp($import_test_views = TRUE) { parent::setUp($import_test_views); protected function setUp($import_test_views = TRUE, $modules = ['translation_views_test_views']) { parent::setUp($import_test_views, $modules); $user = $this->drupalCreateUser([ 'administer content types', Loading @@ -154,8 +160,6 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { $this->drupalLogin($user); ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); // Add two languages. $this->addLanguages(['de', 'fr']); Loading @@ -163,15 +167,18 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { $this->enableTranslation('comment', 'comment'); // Add 3 nodes. $this->drupalPostForm('node/add/article', [ $this->drupalGet('node/add/article'); $this->submitForm([ 'title[0][value]' => 'node 1', 'created[0][value][date]' => '2018-04-01', ], t('Save')); $this->drupalPostForm('node/add/article', [ $this->drupalGet('node/add/article'); $this->submitForm([ 'title[0][value]' => 'node 2', 'created[0][value][date]' => '2018-04-02', ], t('Save')); $this->drupalPostForm('node/add/article', [ $this->drupalGet('node/add/article'); $this->submitForm([ 'title[0][value]' => 'node 3', 'created[0][value][date]' => '2018-04-03', ], t('Save')); Loading @@ -183,42 +190,48 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 1 en comment', ]; $this->drupalPostForm('node/1', $edit, 'Save'); $this->drupalGet('node/1'); $this->submitForm($edit, 'Save'); // Comment 2. $edit = [ 'langcode[0][value]' => 'de', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 1 de comment', ]; $this->drupalPostForm('node/1', $edit, 'Save'); $this->drupalGet('node/1'); $this->submitForm($edit, 'Save'); // Comment 3. $edit = [ 'langcode[0][value]' => 'de', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 2 de comment', ]; $this->drupalPostForm('node/2', $edit, 'Save'); $this->drupalGet('node/2'); $this->submitForm($edit, 'Save'); // Comment 4. $edit = [ 'langcode[0][value]' => 'fr', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 2 fr comment', ]; $this->drupalPostForm('node/2', $edit, 'Save'); $this->drupalGet('node/2'); $this->submitForm($edit, 'Save'); // Comment 5. $edit = [ 'langcode[0][value]' => 'fr', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 3 fr comment', ]; $this->drupalPostForm('node/3', $edit, 'Save'); $this->drupalGet('node/3'); $this->submitForm($edit, 'Save'); // Comment 6. $edit = [ 'content_translation[retranslate]' => 1, 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 3 en from fr comment', ]; $this->drupalPostForm('comment/5/translations/add/fr/en', $edit, 'Save'); $this->drupalGet('comment/5/translations/add/fr/en'); $this->submitForm($edit, 'Save'); } /** Loading tests/src/Functional/ContentFullViewFiltersFieldsTest.php +14 −11 Original line number Diff line number Diff line Loading @@ -35,8 +35,8 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { /** * {@inheritdoc} */ protected function setUp($import_test_views = TRUE) { parent::setUp($import_test_views); protected function setUp($import_test_views = TRUE, $modules = ['translation_views_test_views']) { parent::setUp($import_test_views, $modules); $user = $this->drupalCreateUser([ 'administer site configuration', Loading @@ -53,8 +53,6 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { ]); $this->drupalLogin($user); ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); $langcodes = ['de', 'fr']; foreach ($langcodes as $langcode) { ConfigurableLanguage::createFromLangcode($langcode)->save(); Loading @@ -66,7 +64,8 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { 'settings[node][article][translatable]' => 1, 'settings[node][article][settings][language][language_alterable]' => 1, ]; $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); $this->drupalGet('admin/config/regional/content-language'); $this->submitForm($edit, t('Save configuration')); \Drupal::entityTypeManager()->clearCachedDefinitions(); // Create a node in en (node1). Loading @@ -74,30 +73,34 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { 'title[0][value]' => '001_en_title_node1', 'langcode[0][value]' => 'en', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create a translation in fr (node1). $edit = [ 'title[0][value]' => '002_fr_title_node1', ]; $this->drupalPostForm('node/1/translations/add/en/fr', $edit, t('Save (this translation)')); $this->drupalGet('node/1/translations/add/en/fr'); $this->submitForm($edit, t('Save (this translation)')); // Create a translation in de (node1). $edit = [ 'title[0][value]' => '003_de_title_node1', ]; $this->drupalPostForm('node/1/translations/add/en/de', $edit, t('Save (this translation)')); $this->drupalGet('node/1/translations/add/en/de'); $this->submitForm($edit, t('Save (this translation)')); // Create a node in de (node2). $edit = [ 'title[0][value]' => '004_de_title_node2', 'langcode[0][value]' => 'de', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create a translation in fr (node2). $edit = [ 'title[0][value]' => '005_fr_title_node2', ]; $this->drupalPostForm('node/2/translations/add/de/fr', $edit, t('Save (this translation)')); $this->drupalGet('node/2/translations/add/de/fr'); $this->submitForm($edit, t('Save (this translation)')); } /** Loading tests/src/Functional/ContentModerationIntegration.php +4 −5 Original line number Diff line number Diff line Loading @@ -40,20 +40,19 @@ class ContentModerationIntegration extends ViewTestBase { /** * {@inheritdoc} */ public function setUp($import_test_views = TRUE) { public function setUp($import_test_views = TRUE, $modules = ['translation_views_test_views']) { // Inherit set up from the parent class. parent::setUp($import_test_views); parent::setUp($import_test_views, $modules); // Login as a root user. $this->drupalLogin($this->rootUser); // Import test views. ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); // Create additional languages. foreach (self::$langcodes as $langcode) { ConfigurableLanguage::createFromLangcode($langcode)->save(); } // Enable translation for article nodes. $this->drupalPostForm('admin/config/regional/content-language', [ $this->drupalGet('admin/config/regional/content-language'); $this->submitForm([ "entity_types[node]" => 1, "settings[node][article][translatable]" => 1, "settings[node][article][settings][language][language_alterable]" => 1, Loading tests/src/Functional/ContentTranslationJobsViewTest.php +10 −5 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ class ContentTranslationJobsViewTest extends BrowserTestBase { 'settings[node][article][translatable]' => 1, 'settings[node][article][settings][language][language_alterable]' => 1, ]; $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); $this->drupalGet('admin/config/regional/content-language'); $this->submitForm($edit, t('Save configuration')); \Drupal::entityTypeManager()->clearCachedDefinitions(); // Create node1 in german. Loading @@ -64,27 +65,31 @@ class ContentTranslationJobsViewTest extends BrowserTestBase { 'title[0][value]' => 'node1 de', 'langcode[0][value]' => 'de', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create node1 translation in french. $edit = [ 'title[0][value]' => 'node1 fr', ]; $this->drupalPostForm('node/1/translations/add/de/fr', $edit, t('Save (this translation)')); $this->drupalGet('node/1/translations/add/de/fr'); $this->submitForm($edit, t('Save (this translation)')); // Create node2 in english. $edit = [ 'title[0][value]' => 'node2 en', 'langcode[0][value]' => 'en', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create node3 in french. $edit = [ 'title[0][value]' => 'node3 fr', 'langcode[0][value]' => 'fr', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); } /** Loading Loading
tests/modules/translation_views_test_views/test_views/views.view.test_operations_links.yml +0 −12 Original line number Diff line number Diff line Loading @@ -213,18 +213,6 @@ display: operator_limit_selection: false operator_list: { } group: 1 type: id: type table: node_field_data field: type value: article: article entity_type: node entity_field: type plugin_id: bundle expose: operator_limit_selection: false operator_list: { } translation_target_language: id: translation_target_language table: node_translation Loading
tests/src/Functional/CommentFullViewFiltersFieldsTest.php +27 −14 Original line number Diff line number Diff line Loading @@ -33,6 +33,11 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { private $viewPath = 'comment-translation'; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * Checks that text is in specific row. * Loading Loading @@ -90,7 +95,8 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { * Entity subcategory (e.g. Article). */ private function enableTranslation($category, $subcategory) { $this->drupalPostForm('admin/config/regional/content-language', [ $this->drupalGet('admin/config/regional/content-language'); $this->submitForm([ "entity_types[$category]" => 1, "settings[$category][$subcategory][translatable]" => 1, "settings[$category][$subcategory][settings][language][language_alterable]" => 1, Loading Loading @@ -127,8 +133,8 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { /** * {@inheritdoc} */ protected function setUp($import_test_views = TRUE) { parent::setUp($import_test_views); protected function setUp($import_test_views = TRUE, $modules = ['translation_views_test_views']) { parent::setUp($import_test_views, $modules); $user = $this->drupalCreateUser([ 'administer content types', Loading @@ -154,8 +160,6 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { $this->drupalLogin($user); ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); // Add two languages. $this->addLanguages(['de', 'fr']); Loading @@ -163,15 +167,18 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { $this->enableTranslation('comment', 'comment'); // Add 3 nodes. $this->drupalPostForm('node/add/article', [ $this->drupalGet('node/add/article'); $this->submitForm([ 'title[0][value]' => 'node 1', 'created[0][value][date]' => '2018-04-01', ], t('Save')); $this->drupalPostForm('node/add/article', [ $this->drupalGet('node/add/article'); $this->submitForm([ 'title[0][value]' => 'node 2', 'created[0][value][date]' => '2018-04-02', ], t('Save')); $this->drupalPostForm('node/add/article', [ $this->drupalGet('node/add/article'); $this->submitForm([ 'title[0][value]' => 'node 3', 'created[0][value][date]' => '2018-04-03', ], t('Save')); Loading @@ -183,42 +190,48 @@ class CommentFullViewFiltersFieldsTest extends ViewTestBase { 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 1 en comment', ]; $this->drupalPostForm('node/1', $edit, 'Save'); $this->drupalGet('node/1'); $this->submitForm($edit, 'Save'); // Comment 2. $edit = [ 'langcode[0][value]' => 'de', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 1 de comment', ]; $this->drupalPostForm('node/1', $edit, 'Save'); $this->drupalGet('node/1'); $this->submitForm($edit, 'Save'); // Comment 3. $edit = [ 'langcode[0][value]' => 'de', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 2 de comment', ]; $this->drupalPostForm('node/2', $edit, 'Save'); $this->drupalGet('node/2'); $this->submitForm($edit, 'Save'); // Comment 4. $edit = [ 'langcode[0][value]' => 'fr', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 2 fr comment', ]; $this->drupalPostForm('node/2', $edit, 'Save'); $this->drupalGet('node/2'); $this->submitForm($edit, 'Save'); // Comment 5. $edit = [ 'langcode[0][value]' => 'fr', 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 3 fr comment', ]; $this->drupalPostForm('node/3', $edit, 'Save'); $this->drupalGet('node/3'); $this->submitForm($edit, 'Save'); // Comment 6. $edit = [ 'content_translation[retranslate]' => 1, 'comment_body[0][value]' => $this->loremIpsum, 'subject[0][value]' => 'node 3 en from fr comment', ]; $this->drupalPostForm('comment/5/translations/add/fr/en', $edit, 'Save'); $this->drupalGet('comment/5/translations/add/fr/en'); $this->submitForm($edit, 'Save'); } /** Loading
tests/src/Functional/ContentFullViewFiltersFieldsTest.php +14 −11 Original line number Diff line number Diff line Loading @@ -35,8 +35,8 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { /** * {@inheritdoc} */ protected function setUp($import_test_views = TRUE) { parent::setUp($import_test_views); protected function setUp($import_test_views = TRUE, $modules = ['translation_views_test_views']) { parent::setUp($import_test_views, $modules); $user = $this->drupalCreateUser([ 'administer site configuration', Loading @@ -53,8 +53,6 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { ]); $this->drupalLogin($user); ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); $langcodes = ['de', 'fr']; foreach ($langcodes as $langcode) { ConfigurableLanguage::createFromLangcode($langcode)->save(); Loading @@ -66,7 +64,8 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { 'settings[node][article][translatable]' => 1, 'settings[node][article][settings][language][language_alterable]' => 1, ]; $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); $this->drupalGet('admin/config/regional/content-language'); $this->submitForm($edit, t('Save configuration')); \Drupal::entityTypeManager()->clearCachedDefinitions(); // Create a node in en (node1). Loading @@ -74,30 +73,34 @@ class ContentFullViewFiltersFieldsTest extends ViewTestBase { 'title[0][value]' => '001_en_title_node1', 'langcode[0][value]' => 'en', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create a translation in fr (node1). $edit = [ 'title[0][value]' => '002_fr_title_node1', ]; $this->drupalPostForm('node/1/translations/add/en/fr', $edit, t('Save (this translation)')); $this->drupalGet('node/1/translations/add/en/fr'); $this->submitForm($edit, t('Save (this translation)')); // Create a translation in de (node1). $edit = [ 'title[0][value]' => '003_de_title_node1', ]; $this->drupalPostForm('node/1/translations/add/en/de', $edit, t('Save (this translation)')); $this->drupalGet('node/1/translations/add/en/de'); $this->submitForm($edit, t('Save (this translation)')); // Create a node in de (node2). $edit = [ 'title[0][value]' => '004_de_title_node2', 'langcode[0][value]' => 'de', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create a translation in fr (node2). $edit = [ 'title[0][value]' => '005_fr_title_node2', ]; $this->drupalPostForm('node/2/translations/add/de/fr', $edit, t('Save (this translation)')); $this->drupalGet('node/2/translations/add/de/fr'); $this->submitForm($edit, t('Save (this translation)')); } /** Loading
tests/src/Functional/ContentModerationIntegration.php +4 −5 Original line number Diff line number Diff line Loading @@ -40,20 +40,19 @@ class ContentModerationIntegration extends ViewTestBase { /** * {@inheritdoc} */ public function setUp($import_test_views = TRUE) { public function setUp($import_test_views = TRUE, $modules = ['translation_views_test_views']) { // Inherit set up from the parent class. parent::setUp($import_test_views); parent::setUp($import_test_views, $modules); // Login as a root user. $this->drupalLogin($this->rootUser); // Import test views. ViewTestData::createTestViews(get_class($this), ['translation_views_test_views']); // Create additional languages. foreach (self::$langcodes as $langcode) { ConfigurableLanguage::createFromLangcode($langcode)->save(); } // Enable translation for article nodes. $this->drupalPostForm('admin/config/regional/content-language', [ $this->drupalGet('admin/config/regional/content-language'); $this->submitForm([ "entity_types[node]" => 1, "settings[node][article][translatable]" => 1, "settings[node][article][settings][language][language_alterable]" => 1, Loading
tests/src/Functional/ContentTranslationJobsViewTest.php +10 −5 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ class ContentTranslationJobsViewTest extends BrowserTestBase { 'settings[node][article][translatable]' => 1, 'settings[node][article][settings][language][language_alterable]' => 1, ]; $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); $this->drupalGet('admin/config/regional/content-language'); $this->submitForm($edit, t('Save configuration')); \Drupal::entityTypeManager()->clearCachedDefinitions(); // Create node1 in german. Loading @@ -64,27 +65,31 @@ class ContentTranslationJobsViewTest extends BrowserTestBase { 'title[0][value]' => 'node1 de', 'langcode[0][value]' => 'de', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create node1 translation in french. $edit = [ 'title[0][value]' => 'node1 fr', ]; $this->drupalPostForm('node/1/translations/add/de/fr', $edit, t('Save (this translation)')); $this->drupalGet('node/1/translations/add/de/fr'); $this->submitForm($edit, t('Save (this translation)')); // Create node2 in english. $edit = [ 'title[0][value]' => 'node2 en', 'langcode[0][value]' => 'en', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); // Create node3 in french. $edit = [ 'title[0][value]' => 'node3 fr', 'langcode[0][value]' => 'fr', ]; $this->drupalPostForm('node/add/article', $edit, t('Save')); $this->drupalGet('node/add/article'); $this->submitForm($edit, t('Save')); } /** Loading