3 namespace Drupal\metatag_favicons\Tests;
5 use Drupal\simpletest\WebTestBase;
6 use Drupal\metatag\Tests\MetatagTagsTestBase;
9 * Tests that each of the Metatag Favicons tags work correctly.
13 class MetatagFaviconsTagsTest extends MetatagTagsTestBase {
22 * The tag to look for when testing the output.
24 public $test_tag = 'meta';
27 * The attribute to look for to indicate which tag.
29 public $test_name_attribute = 'property';
34 protected function setUp() {
35 parent::$modules[] = 'metatag_favicons';
40 * Each of these meta tags has a different tag name vs its internal name.
42 public function getTestTagName($tag_name) {
43 // Replace the first underline with a colon.
44 $tag_name = str_replace('og_', 'og:', $tag_name);
45 $tag_name = str_replace('article_', 'article:', $tag_name);
47 // Some tags have an additional underline that turns into a colon.
48 $tag_name = str_replace('og:image_', 'og:image:', $tag_name);
49 $tag_name = str_replace('og:video_', 'og:video:', $tag_name);
52 if ($tag_name == 'og:locale_alternative') {
53 $tag_name = 'og:locale:alternate';