Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / metatag / metatag_twitter_cards / src / Tests / MetatagTwitterCardsTagsTest.php
index 602ac119b3ebc871827207bf8cda36367204fa54..b718d0156e94fed671bc47953edc7713b431c1e0 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\metatag_twitter_cards\Tests;
 
-use Drupal\simpletest\WebTestBase;
 use Drupal\metatag\Tests\MetatagTagsTestBase;
 
 /**
@@ -15,7 +14,7 @@ class MetatagTwitterCardsTagsTest extends MetatagTagsTestBase {
   /**
    * {@inheritdoc}
    */
-  public $tags = [
+  private $tags = [
     'twitter_cards_app_id_googleplay',
     'twitter_cards_app_id_ipad',
     'twitter_cards_app_id_iphone',
@@ -31,6 +30,7 @@ class MetatagTwitterCardsTagsTest extends MetatagTagsTestBase {
     'twitter_cards_data1',
     'twitter_cards_data2',
     'twitter_cards_description',
+    'twitter_cards_donottrack',
     'twitter_cards_gallery_image0',
     'twitter_cards_gallery_image1',
     'twitter_cards_gallery_image2',
@@ -62,10 +62,11 @@ class MetatagTwitterCardsTagsTest extends MetatagTagsTestBase {
   }
 
   /**
-   * Twitter meta tags (almost) all have colons instead of underlines, and they
-   * don't have "cards" in their name.
+   * Twitter meta tags (almost) all have colons instead of underlines.
+   *
+   * They also don't have "cards" in their name.
    */
-  public function getTestTagName($tag_name) {
+  private function getTestTagName($tag_name) {
     $tag_name = str_replace('twitter_cards', 'twitter', $tag_name);
     $tag_name = str_replace('_', ':', $tag_name);
 
@@ -81,24 +82,24 @@ class MetatagTwitterCardsTagsTest extends MetatagTagsTestBase {
     elseif ($tag_name == 'twitter:type') {
       $tag_name = 'twitter:card';
     }
-    elseif ($tag_name == '') {
-      $tag_name = '';
+    elseif ($tag_name == 'twitter:donottrack') {
+      $tag_name = 'twitter:dnt';
     }
 
     return $tag_name;
   }
 
   /**
-   * Implements {meta_tag_name}_test_field_xpath() for 'twitter_cards_type'.
+   * Implements {tag_name}TestFieldXpath() for 'twitter_cards_type'.
    */
-  public function twitter_cards_type_test_field_xpath() {
+  private function twitterCardsTypeTestFieldXpath() {
     return "//select[@name='twitter_cards_type']";
   }
 
   /**
-   * Implements {meta_tag_name}_test_value() for 'twitter_cards_type'.
+   * Implements {tag_name}TestValue() for 'twitter_cards_type'.
    */
-  public function twitter_cards_type_test_value() {
+  private function twitterCardsTypeTestValue() {
     return 'summary_large_image';
   }