3 namespace Drupal\metatag_hreflang\Tests;
5 use Drupal\simpletest\WebTestBase;
6 use Drupal\metatag\Tests\MetatagTagsTestBase;
9 * Tests that each of the Metatag hreflang tags work correctly.
13 class MetatagHreflangTagsTest extends MetatagTagsTestBase {
25 public $test_tag = 'link';
30 public $test_name_attribute = 'hreflang';
35 public $test_value_attribute = 'href';
40 protected function setUp() {
41 parent::$modules[] = 'metatag_hreflang';
46 * Each of these meta tags has a different tag name vs its internal name.
48 public function getTestTagName($tag_name) {
49 return str_replace('hreflang_', '', $tag_name);
53 * Implements {meta_tag_name}_test_output_xpath() for 'hreflang_xdefault'.
55 public function hreflang_xdefault_test_output_xpath() {
56 return "//link[@hreflang='x-default']";