3 namespace Drupal\metatag_pinterest\Tests;
5 use Drupal\metatag\Tests\MetatagTagsTestBase;
8 * Tests that each of the Metatag Pinterest tags work correctly.
12 class MetatagPinterestTagsTest extends MetatagTagsTestBase {
18 'pinterest_description',
30 private $testTag = 'meta';
35 private $testNameAttribute = 'property';
40 protected function setUp() {
41 parent::$modules[] = 'metatag_pinterest';
46 * Each of these meta tags has a different tag name vs its internal name.
48 private function getTestTagName($tag_name) {
49 if ($tag_name == ('pinterest_nopin' || 'pinterest_nohover' || 'pinterest_nosearch')) {
50 $tag_name = 'pinterest';
53 // Replace "pinterest_" with "pin:".
54 $tag_name = str_replace('pinterest_', 'pin:', $tag_name);
61 * Implements {tag_name}TestFieldXpath() for 'pinterest'.
63 private function pinterestTestFieldXpath() {
64 return "//input[@name='pinterest[index]' and @type='checkbox']";
68 * Implements {tag_name}TestKey() for 'pinterest'.
70 private function pinterestTestKey() {
71 return 'pinterest[index]';
75 * Implements {tag_name}TestValue() for 'pinterest'.
77 private function pinterestTestValue() {