3 namespace Drupal\metatag_google_plus\Tests;
5 use Drupal\simpletest\WebTestBase;
6 use Drupal\metatag\Tests\MetatagTagsTestBase;
9 * Tests that each of the Metatag Google Plus tags work correctly.
13 class MetatagGooglePlusTagsTest extends MetatagTagsTestBase {
20 'google_plus_description',
23 'google_plus_publisher',
27 * The attribute to look for to indicate which tag.
29 public $test_name_attribute = 'itemprop';
34 protected function setUp() {
35 parent::$modules[] = 'metatag_google_plus';
40 * Each of these meta tags has a different tag name vs its internal name.
42 public function getTestTagName($tag_name) {
43 $tag_name = str_replace('google_plus_', 'itemprop:', $tag_name);
44 if ($tag_name == 'itemprop:publisher') {
45 $tag_name = 'publisher';
51 * Implements {meta_tag_name}_test_name_attribute() for 'author'.
53 public function google_plus_author_test_output_xpath() {
54 return "//link[@rel='author']";
58 * Implements {meta_tag_name}_test_value_attribute() for 'author'.
60 public function google_plus_author_test_value_attribute() {
65 * Implements {meta_tag_name}_test_name_attribute() for 'publisher'.
67 public function google_plus_publisher_test_output_xpath() {
68 return "//link[@rel='publisher']";
72 * Implements {meta_tag_name}_test_value_attribute() for 'publisher'.
74 public function google_plus_publisher_test_value_attribute() {