namespace Drupal\metatag_twitter_cards\Tests;
-use Drupal\simpletest\WebTestBase;
use Drupal\metatag\Tests\MetatagTagsTestBase;
/**
/**
* {@inheritdoc}
*/
- public $tags = [
+ private $tags = [
'twitter_cards_app_id_googleplay',
'twitter_cards_app_id_ipad',
'twitter_cards_app_id_iphone',
'twitter_cards_data1',
'twitter_cards_data2',
'twitter_cards_description',
+ 'twitter_cards_donottrack',
'twitter_cards_gallery_image0',
'twitter_cards_gallery_image1',
'twitter_cards_gallery_image2',
}
/**
- * 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);
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';
}