3 namespace Drupal\metatag_open_graph_products\Tests;
5 use Drupal\metatag\Tests\MetatagTagsTestBase;
8 * Tests that each of the Metatag Open Graph tags work correctly.
12 class MetatagOpenGraphProductsTagsTest extends MetatagTagsTestBase {
22 private $testTag = 'meta';
27 private $testNameAttribute = 'property';
32 protected function setUp() {
33 parent::$modules[] = 'metatag_open_graph_products';
38 * Each of these meta tags has a different tag name vs its internal name.
40 private function getTestTagName($tag_name) {
41 // Replace the first underline with a colon.
42 $tag_name = str_replace('og_', 'og:', $tag_name);
43 $tag_name = str_replace('article_', 'article:', $tag_name);
45 // Some tags have an additional underline that turns into a colon.
46 $tag_name = str_replace('og:image_', 'og:image:', $tag_name);
47 $tag_name = str_replace('og:video_', 'og:video:', $tag_name);
50 if ($tag_name == 'og:locale_alternative') {
51 $tag_name = 'og:locale:alternate';