bfa93d886c82bb22f525da8a7bbb4dc7d6005a60
[yaffs-website] / web / modules / contrib / metatag / metatag_hreflang / src / Tests / MetatagHreflangTagsTest.php
1 <?php
2
3 namespace Drupal\metatag_hreflang\Tests;
4
5 use Drupal\simpletest\WebTestBase;
6 use Drupal\metatag\Tests\MetatagTagsTestBase;
7
8 /**
9  * Tests that each of the Metatag hreflang tags work correctly.
10  *
11  * @group metatag
12  */
13 class MetatagHreflangTagsTest extends MetatagTagsTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public $tags = [
19     'hreflang_xdefault',
20   ];
21
22   /**
23    * {@inheritdoc}
24    */
25   public $test_tag = 'link';
26
27   /**
28    * {@inheritdoc}
29    */
30   public $test_name_attribute = 'hreflang';
31
32   /**
33    * {@inheritdoc}
34    */
35   public $test_value_attribute = 'href';
36
37   /**
38    * {@inheritdoc}
39    */
40   protected function setUp() {
41     parent::$modules[] = 'metatag_hreflang';
42     parent::setUp();
43   }
44
45   /**
46    * Each of these meta tags has a different tag name vs its internal name.
47    */
48   public function getTestTagName($tag_name) {
49     return str_replace('hreflang_', '', $tag_name);
50   }
51
52   /**
53    * Implements {meta_tag_name}_test_output_xpath() for 'hreflang_xdefault'.
54    */
55   public function hreflang_xdefault_test_output_xpath() {
56     return "//link[@hreflang='x-default']";
57   }
58
59 }