Loading CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx update script to trigger rebuild of caches due to service changes. #3129331 by DamienMcKenna: Resolve problems with MetatagViewsBasicsTest:: testViewsUi. #3129357 by DamienMcKenna: Standardize on assertSession()->statusCodeEquals instead of assertResponse(). Metatag 8.x-1.12, 2020-03-30 Loading tests/src/Functional/MetatagAdminTest.php +29 −28 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class MetatagAdminTest extends BrowserTestBase { // Check that the user can see the list of metatag defaults. $this->drupalGet('admin/config/search/metatag'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Check that the Global defaults were created. $this->assertLinkByHref('admin/config/search/metatag/global', 0, $this->t('Global defaults were created on installation.')); Loading @@ -97,12 +97,12 @@ class MetatagAdminTest extends BrowserTestBase { // Check that the module defaults were injected into the Global config // entity. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertFieldById('edit-title', $metatag_defaults->get('title'), $this->t('Metatag defaults were injected into the Global configuration entity.')); // Update the Global defaults and test them. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => 'Test title', 'description' => 'Test description', Loading @@ -110,14 +110,14 @@ class MetatagAdminTest extends BrowserTestBase { $this->drupalPostForm(NULL, $values, 'Save'); $this->assertText('Saved the Global Metatag defaults.'); $this->drupalGet('hit-a-404'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Updated metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag])); } // Check that tokens are processed. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => '[site:name] | Test title', 'description' => '[site:name] | Test description', Loading @@ -126,7 +126,7 @@ class MetatagAdminTest extends BrowserTestBase { $this->assertText('Saved the Global Metatag defaults.'); drupal_flush_all_caches(); $this->drupalGet('hit-a-404'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); foreach ($values as $metatag => $value) { $processed_value = \Drupal::token()->replace($value); $this->assertRaw($processed_value, $this->t('Processed token for metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag])); Loading @@ -134,7 +134,7 @@ class MetatagAdminTest extends BrowserTestBase { // Test the Robots plugin. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $robots_values = ['index', 'follow', 'noydir']; $values = []; foreach ($robots_values as $value) { Loading @@ -146,13 +146,13 @@ class MetatagAdminTest extends BrowserTestBase { // Trigger a 404 request. $this->drupalGet('hit-a-404'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); $robots_value = implode(', ', $robots_values); $this->assertRaw($robots_value, $this->t('Robots metatag has the expected values.')); // Test reverting global configuration to its defaults. $this->drupalGet('admin/config/search/metatag/global/revert'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->drupalPostForm(NULL, [], 'Revert'); $this->assertText('Reverted Global defaults.'); $this->assertText($default_title, 'Global title was reverted to its default value.'); Loading @@ -174,7 +174,7 @@ class MetatagAdminTest extends BrowserTestBase { // Load the default-add page. $this->drupalGet('admin/config/search/metatag/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Confirm the 'type' field exists. $this->assertFieldByName('id'); Loading Loading @@ -208,19 +208,19 @@ class MetatagAdminTest extends BrowserTestBase { // Adjust the front page and test it. $this->drupalGet('admin/config/search/metatag/front'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'description' => 'Front page description', ]; $this->drupalPostForm(NULL, $values, 'Save'); $this->assertText('Saved the Front page Metatag defaults.'); $this->drupalGet('<front>'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertRaw($values['description'], $this->t('Front page defaults are used at the front page.')); // Adjust the 403 page and test it. $this->drupalGet('admin/config/search/metatag/403'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'description' => '403 page description.', ]; Loading @@ -228,20 +228,20 @@ class MetatagAdminTest extends BrowserTestBase { $this->assertText('Saved the 403 access denied Metatag defaults.'); $this->drupalLogout(); $this->drupalGet('admin/config/search/metatag'); $this->assertResponse(403); $this->assertSession()->statusCodeEquals(403); $this->assertRaw($values['description'], $this->t('403 page defaults are used at 403 pages.')); // Adjust the 404 page and test it. $this->drupalLogin($account); $this->drupalGet('admin/config/search/metatag/404'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'description' => '404 page description.', ]; $this->drupalPostForm(NULL, $values, 'Save'); $this->assertText('Saved the 404 page not found Metatag defaults.'); $this->drupalGet('foo'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); $this->assertRaw($values['description'], $this->t('404 page defaults are used at 404 pages.')); $this->drupalLogout(); } Loading @@ -265,7 +265,7 @@ class MetatagAdminTest extends BrowserTestBase { // Update the Metatag Node defaults. $this->drupalGet('admin/config/search/metatag/node'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => 'Test title for a node.', 'description' => 'Test description for a node.', Loading @@ -281,7 +281,7 @@ class MetatagAdminTest extends BrowserTestBase { // Check that the new values are found in the response. $this->drupalGet('node/' . $node->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Node metatag @tag overrides Global defaults.', ['@tag' => $metatag])); } Loading @@ -290,7 +290,7 @@ class MetatagAdminTest extends BrowserTestBase { // is used. // First unset node defaults. $this->drupalGet('admin/config/search/metatag/node'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => '', 'description' => '', Loading @@ -300,7 +300,7 @@ class MetatagAdminTest extends BrowserTestBase { // Then, set global ones. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => 'Global title', 'description' => 'Global description', Loading @@ -319,14 +319,14 @@ class MetatagAdminTest extends BrowserTestBase { 'type' => 'article', ]); $this->drupalGet('node/' . $node->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Found global @tag tag as Node does not set it.', ['@tag' => $metatag])); } // Now create article overrides and then test them. $this->drupalGet('admin/config/search/metatag/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'id' => 'node__article', 'title' => 'Article title override', Loading @@ -341,7 +341,7 @@ class MetatagAdminTest extends BrowserTestBase { 'type' => 'article', ]); $this->drupalGet('node/' . $node->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); unset($values['id']); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Found bundle override for tag @tag.', ['@tag' => $metatag])); Loading @@ -349,7 +349,7 @@ class MetatagAdminTest extends BrowserTestBase { // Test deleting the article defaults. $this->drupalGet('admin/config/search/metatag/node__article/delete'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->drupalPostForm(NULL, [], 'Delete'); $this->assertText($this->t('Deleted @label defaults.', ['@label' => 'Content: Article'])); } Loading Loading @@ -377,7 +377,7 @@ class MetatagAdminTest extends BrowserTestBase { // Add a Metatag field to the Article content type. $this->drupalGet('admin/structure/types/manage/article/fields/add-field'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'new_storage_type' => 'metatag', 'label' => 'Meta tags', Loading @@ -392,13 +392,13 @@ class MetatagAdminTest extends BrowserTestBase { // Try creating an article, confirm the fields are present. This should be // the node default values that are shown. $this->drupalGet('node/add/article'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]'); $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]'); // Customize the Article content type defaults. $this->drupalGet('admin/config/search/metatag/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'id' => 'node__article', 'title' => 'Article title override', Loading @@ -409,7 +409,7 @@ class MetatagAdminTest extends BrowserTestBase { // Try creating an article, this time with the overridden defaults. $this->drupalGet('node/add/article'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertFieldByName('field_meta_tags[0][basic][title]', 'Article title override'); $this->assertFieldByName('field_meta_tags[0][basic][description]', 'Article description override'); } Loading Loading @@ -459,6 +459,7 @@ class MetatagAdminTest extends BrowserTestBase { $this->loginUser1(); $this->drupalGet('admin/config/search/metatag'); $this->assertSession()->statusCodeEquals(200); $this->assertLinkByHref('/admin/config/search/metatag/global'); $this->assertLinkByHref('/admin/config/search/metatag/front'); $this->assertLinkByHref('/admin/config/search/metatag/403'); Loading tests/src/Functional/MetatagConfigTranslationTest.php +9 −9 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ class MetatagConfigTranslationTest extends BrowserTestBase { // Enable the French language. $this->drupalGet('admin/config/regional/language/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'predefined_langcode' => 'fr', ]; Loading @@ -90,12 +90,12 @@ class MetatagConfigTranslationTest extends BrowserTestBase { public function testConfigTranslationsExist() { // Ensure the config shows on the admin form. $this->drupalGet('admin/config/regional/config-translation'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertText($this->t('Metatag defaults')); // Load the main metatag_defaults config translation page. $this->drupalGet('admin/config/regional/config-translation/metatag_defaults'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // @todo Update this to confirm the H1 is loaded. $this->assertRaw($this->t('Metatag defaults')); Loading @@ -116,7 +116,7 @@ class MetatagConfigTranslationTest extends BrowserTestBase { foreach ($defaults as $config_name) { if ($config_entity = $config_manager->loadConfigEntityByName($config_name)) { $this->drupalGet('admin/config/search/metatag/' . $config_entity->id() . '/translate'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); } else { $this->error('Unable to load a Metatag default config: ' . $config_name); Loading @@ -130,22 +130,22 @@ class MetatagConfigTranslationTest extends BrowserTestBase { public function testConfigTranslations() { // Add something to the Global config. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'title' => 'Test title', 'description' => 'Test description', ]; $this->drupalPostForm(NULL, $edit, $this->t('Save')); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertText($this->t('Saved the Global Metatag defaults.')); // Confirm the config has languages available to translate into. $this->drupalGet('admin/config/search/metatag/global/translate'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Load the translation form. $this->drupalGet('admin/config/search/metatag/global/translate/fr/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Confirm the meta tag fields are shown on the form. Confirm the fields and // values separately to make it easier to pinpoint where the problem is if Loading @@ -161,7 +161,7 @@ class MetatagConfigTranslationTest extends BrowserTestBase { 'translation[config_names][metatag.metatag_defaults.global][tags][description]' => 'Le description', ]; $this->drupalPostForm(NULL, $edit, $this->t('Save translation')); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertText($this->t('Successfully saved French translation')); } Loading tests/src/Functional/MetatagCustomRouteTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class MetatagCustomRouteTest extends BrowserTestBase { ])->save(); $this->drupalGet('metatag_test_custom_route/' . $entity_test->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $xpath = $this->xpath("//meta[@name='keywords']"); $this->assertEqual(count($xpath), 1); $this->assertEqual($xpath[0]->getAttribute('content'), 'test'); Loading tests/src/Functional/MetatagFieldTermTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ class MetatagFieldTermTest extends MetatagFieldTestBase { $this->adminUser = $this->drupalCreateUser($all_perms); $this->drupalLogin($this->adminUser); $this->drupalGet('admin/structure/taxonomy/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'name' => 'Tags', 'vid' => 'tags', Loading Loading
CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx update script to trigger rebuild of caches due to service changes. #3129331 by DamienMcKenna: Resolve problems with MetatagViewsBasicsTest:: testViewsUi. #3129357 by DamienMcKenna: Standardize on assertSession()->statusCodeEquals instead of assertResponse(). Metatag 8.x-1.12, 2020-03-30 Loading
tests/src/Functional/MetatagAdminTest.php +29 −28 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class MetatagAdminTest extends BrowserTestBase { // Check that the user can see the list of metatag defaults. $this->drupalGet('admin/config/search/metatag'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Check that the Global defaults were created. $this->assertLinkByHref('admin/config/search/metatag/global', 0, $this->t('Global defaults were created on installation.')); Loading @@ -97,12 +97,12 @@ class MetatagAdminTest extends BrowserTestBase { // Check that the module defaults were injected into the Global config // entity. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertFieldById('edit-title', $metatag_defaults->get('title'), $this->t('Metatag defaults were injected into the Global configuration entity.')); // Update the Global defaults and test them. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => 'Test title', 'description' => 'Test description', Loading @@ -110,14 +110,14 @@ class MetatagAdminTest extends BrowserTestBase { $this->drupalPostForm(NULL, $values, 'Save'); $this->assertText('Saved the Global Metatag defaults.'); $this->drupalGet('hit-a-404'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Updated metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag])); } // Check that tokens are processed. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => '[site:name] | Test title', 'description' => '[site:name] | Test description', Loading @@ -126,7 +126,7 @@ class MetatagAdminTest extends BrowserTestBase { $this->assertText('Saved the Global Metatag defaults.'); drupal_flush_all_caches(); $this->drupalGet('hit-a-404'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); foreach ($values as $metatag => $value) { $processed_value = \Drupal::token()->replace($value); $this->assertRaw($processed_value, $this->t('Processed token for metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag])); Loading @@ -134,7 +134,7 @@ class MetatagAdminTest extends BrowserTestBase { // Test the Robots plugin. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $robots_values = ['index', 'follow', 'noydir']; $values = []; foreach ($robots_values as $value) { Loading @@ -146,13 +146,13 @@ class MetatagAdminTest extends BrowserTestBase { // Trigger a 404 request. $this->drupalGet('hit-a-404'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); $robots_value = implode(', ', $robots_values); $this->assertRaw($robots_value, $this->t('Robots metatag has the expected values.')); // Test reverting global configuration to its defaults. $this->drupalGet('admin/config/search/metatag/global/revert'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->drupalPostForm(NULL, [], 'Revert'); $this->assertText('Reverted Global defaults.'); $this->assertText($default_title, 'Global title was reverted to its default value.'); Loading @@ -174,7 +174,7 @@ class MetatagAdminTest extends BrowserTestBase { // Load the default-add page. $this->drupalGet('admin/config/search/metatag/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Confirm the 'type' field exists. $this->assertFieldByName('id'); Loading Loading @@ -208,19 +208,19 @@ class MetatagAdminTest extends BrowserTestBase { // Adjust the front page and test it. $this->drupalGet('admin/config/search/metatag/front'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'description' => 'Front page description', ]; $this->drupalPostForm(NULL, $values, 'Save'); $this->assertText('Saved the Front page Metatag defaults.'); $this->drupalGet('<front>'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertRaw($values['description'], $this->t('Front page defaults are used at the front page.')); // Adjust the 403 page and test it. $this->drupalGet('admin/config/search/metatag/403'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'description' => '403 page description.', ]; Loading @@ -228,20 +228,20 @@ class MetatagAdminTest extends BrowserTestBase { $this->assertText('Saved the 403 access denied Metatag defaults.'); $this->drupalLogout(); $this->drupalGet('admin/config/search/metatag'); $this->assertResponse(403); $this->assertSession()->statusCodeEquals(403); $this->assertRaw($values['description'], $this->t('403 page defaults are used at 403 pages.')); // Adjust the 404 page and test it. $this->drupalLogin($account); $this->drupalGet('admin/config/search/metatag/404'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'description' => '404 page description.', ]; $this->drupalPostForm(NULL, $values, 'Save'); $this->assertText('Saved the 404 page not found Metatag defaults.'); $this->drupalGet('foo'); $this->assertResponse(404); $this->assertSession()->statusCodeEquals(404); $this->assertRaw($values['description'], $this->t('404 page defaults are used at 404 pages.')); $this->drupalLogout(); } Loading @@ -265,7 +265,7 @@ class MetatagAdminTest extends BrowserTestBase { // Update the Metatag Node defaults. $this->drupalGet('admin/config/search/metatag/node'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => 'Test title for a node.', 'description' => 'Test description for a node.', Loading @@ -281,7 +281,7 @@ class MetatagAdminTest extends BrowserTestBase { // Check that the new values are found in the response. $this->drupalGet('node/' . $node->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Node metatag @tag overrides Global defaults.', ['@tag' => $metatag])); } Loading @@ -290,7 +290,7 @@ class MetatagAdminTest extends BrowserTestBase { // is used. // First unset node defaults. $this->drupalGet('admin/config/search/metatag/node'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => '', 'description' => '', Loading @@ -300,7 +300,7 @@ class MetatagAdminTest extends BrowserTestBase { // Then, set global ones. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'title' => 'Global title', 'description' => 'Global description', Loading @@ -319,14 +319,14 @@ class MetatagAdminTest extends BrowserTestBase { 'type' => 'article', ]); $this->drupalGet('node/' . $node->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Found global @tag tag as Node does not set it.', ['@tag' => $metatag])); } // Now create article overrides and then test them. $this->drupalGet('admin/config/search/metatag/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'id' => 'node__article', 'title' => 'Article title override', Loading @@ -341,7 +341,7 @@ class MetatagAdminTest extends BrowserTestBase { 'type' => 'article', ]); $this->drupalGet('node/' . $node->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); unset($values['id']); foreach ($values as $metatag => $value) { $this->assertRaw($value, $this->t('Found bundle override for tag @tag.', ['@tag' => $metatag])); Loading @@ -349,7 +349,7 @@ class MetatagAdminTest extends BrowserTestBase { // Test deleting the article defaults. $this->drupalGet('admin/config/search/metatag/node__article/delete'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->drupalPostForm(NULL, [], 'Delete'); $this->assertText($this->t('Deleted @label defaults.', ['@label' => 'Content: Article'])); } Loading Loading @@ -377,7 +377,7 @@ class MetatagAdminTest extends BrowserTestBase { // Add a Metatag field to the Article content type. $this->drupalGet('admin/structure/types/manage/article/fields/add-field'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'new_storage_type' => 'metatag', 'label' => 'Meta tags', Loading @@ -392,13 +392,13 @@ class MetatagAdminTest extends BrowserTestBase { // Try creating an article, confirm the fields are present. This should be // the node default values that are shown. $this->drupalGet('node/add/article'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]'); $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]'); // Customize the Article content type defaults. $this->drupalGet('admin/config/search/metatag/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $values = [ 'id' => 'node__article', 'title' => 'Article title override', Loading @@ -409,7 +409,7 @@ class MetatagAdminTest extends BrowserTestBase { // Try creating an article, this time with the overridden defaults. $this->drupalGet('node/add/article'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertFieldByName('field_meta_tags[0][basic][title]', 'Article title override'); $this->assertFieldByName('field_meta_tags[0][basic][description]', 'Article description override'); } Loading Loading @@ -459,6 +459,7 @@ class MetatagAdminTest extends BrowserTestBase { $this->loginUser1(); $this->drupalGet('admin/config/search/metatag'); $this->assertSession()->statusCodeEquals(200); $this->assertLinkByHref('/admin/config/search/metatag/global'); $this->assertLinkByHref('/admin/config/search/metatag/front'); $this->assertLinkByHref('/admin/config/search/metatag/403'); Loading
tests/src/Functional/MetatagConfigTranslationTest.php +9 −9 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ class MetatagConfigTranslationTest extends BrowserTestBase { // Enable the French language. $this->drupalGet('admin/config/regional/language/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'predefined_langcode' => 'fr', ]; Loading @@ -90,12 +90,12 @@ class MetatagConfigTranslationTest extends BrowserTestBase { public function testConfigTranslationsExist() { // Ensure the config shows on the admin form. $this->drupalGet('admin/config/regional/config-translation'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertText($this->t('Metatag defaults')); // Load the main metatag_defaults config translation page. $this->drupalGet('admin/config/regional/config-translation/metatag_defaults'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // @todo Update this to confirm the H1 is loaded. $this->assertRaw($this->t('Metatag defaults')); Loading @@ -116,7 +116,7 @@ class MetatagConfigTranslationTest extends BrowserTestBase { foreach ($defaults as $config_name) { if ($config_entity = $config_manager->loadConfigEntityByName($config_name)) { $this->drupalGet('admin/config/search/metatag/' . $config_entity->id() . '/translate'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); } else { $this->error('Unable to load a Metatag default config: ' . $config_name); Loading @@ -130,22 +130,22 @@ class MetatagConfigTranslationTest extends BrowserTestBase { public function testConfigTranslations() { // Add something to the Global config. $this->drupalGet('admin/config/search/metatag/global'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'title' => 'Test title', 'description' => 'Test description', ]; $this->drupalPostForm(NULL, $edit, $this->t('Save')); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertText($this->t('Saved the Global Metatag defaults.')); // Confirm the config has languages available to translate into. $this->drupalGet('admin/config/search/metatag/global/translate'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Load the translation form. $this->drupalGet('admin/config/search/metatag/global/translate/fr/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Confirm the meta tag fields are shown on the form. Confirm the fields and // values separately to make it easier to pinpoint where the problem is if Loading @@ -161,7 +161,7 @@ class MetatagConfigTranslationTest extends BrowserTestBase { 'translation[config_names][metatag.metatag_defaults.global][tags][description]' => 'Le description', ]; $this->drupalPostForm(NULL, $edit, $this->t('Save translation')); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $this->assertText($this->t('Successfully saved French translation')); } Loading
tests/src/Functional/MetatagCustomRouteTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class MetatagCustomRouteTest extends BrowserTestBase { ])->save(); $this->drupalGet('metatag_test_custom_route/' . $entity_test->id()); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $xpath = $this->xpath("//meta[@name='keywords']"); $this->assertEqual(count($xpath), 1); $this->assertEqual($xpath[0]->getAttribute('content'), 'test'); Loading
tests/src/Functional/MetatagFieldTermTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ class MetatagFieldTermTest extends MetatagFieldTestBase { $this->adminUser = $this->drupalCreateUser($all_perms); $this->drupalLogin($this->adminUser); $this->drupalGet('admin/structure/taxonomy/add'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'name' => 'Tags', 'vid' => 'tags', Loading