X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fmetatag%2Fsrc%2FTests%2FMetatagNodeTranslationTest.php;fp=web%2Fmodules%2Fcontrib%2Fmetatag%2Fsrc%2FTests%2FMetatagNodeTranslationTest.php;h=8681258d3fb6d352734ad526efb64c9526147e43;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hp=0e9ff0d707ecc8e7f5a0ac1fbfbb5a5159e4449e;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/modules/contrib/metatag/src/Tests/MetatagNodeTranslationTest.php b/web/modules/contrib/metatag/src/Tests/MetatagNodeTranslationTest.php index 0e9ff0d70..8681258d3 100644 --- a/web/modules/contrib/metatag/src/Tests/MetatagNodeTranslationTest.php +++ b/web/modules/contrib/metatag/src/Tests/MetatagNodeTranslationTest.php @@ -80,8 +80,9 @@ class MetatagNodeTranslationTest extends WebTestBase { $this->drupalCreateContentType(['type' => 'metatag_node', 'name' => $name]); // Add a metatag field to the content type. - $this->drupalGet("admin/structure/types"); - $this->drupalGet("admin/structure/types/manage/metatag_node/fields/add-field"); + $this->drupalGet('admin/structure/types'); + $this->assertResponse(200); + $this->drupalGet('admin/structure/types/manage/metatag_node/fields/add-field'); $this->assertResponse(200); $edit = [ 'label' => 'Metatag', @@ -110,8 +111,15 @@ class MetatagNodeTranslationTest extends WebTestBase { // global default to be used, which contains a token (node:summary). The // token value should be correctly translated. + // Load the node form. + $this->drupalGet('node/add/metatag_node'); + $this->assertResponse(200); + + // Check the default values are correct. + $this->assertFieldByName('field_metatag_field[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.'); + $this->assertFieldByName('field_metatag_field[0][basic][description]', '[node:summary]', 'Default description token is present.'); + // Create a node. - $this->drupalGet("node/add/metatag_node"); $edit = [ 'title[0][value]' => 'Node Français', 'body[0][value]' => 'French summary.', @@ -124,6 +132,10 @@ class MetatagNodeTranslationTest extends WebTestBase { $this->drupalGet('node/1/translations/add/en/es'); $this->assertResponse(200); + // Check the default values are there. + $this->assertFieldByName('field_metatag_field[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.'); + $this->assertFieldByName('field_metatag_field[0][basic][description]', '[node:summary]', 'Default description token is present.'); + $edit = [ 'title[0][value]' => 'Node Español', 'body[0][value]' => 'Spanish summary.', @@ -137,6 +149,12 @@ class MetatagNodeTranslationTest extends WebTestBase { $this->assertEqual($value, 'Spanish summary.'); $this->assertNotEqual($value, 'French summary.'); + $this->drupalGet('node/1/edit'); + $this->assertResponse(200); + // Check the default values are there. + $this->assertFieldByName('field_metatag_field[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.'); + $this->assertFieldByName('field_metatag_field[0][basic][description]', '[node:summary]', 'Default description token is present.'); + // Set explicit values on the description metatag instead using the // defaults. $this->drupalGet('node/1/edit');