MetatagFaviconsTagsTest.php in Metatag 8
File
metatag_favicons/tests/src/Functional/MetatagFaviconsTagsTest.php
View source
<?php
namespace Drupal\Tests\metatag_favicons\Functional;
use Drupal\Tests\metatag\Functional\MetatagTagsTestBase;
class MetatagFaviconsTagsTest extends MetatagTagsTestBase {
protected static $modules = [
'metatag_favicons',
];
protected $tags = [
'shortcut_icon',
'icon_16x16',
'icon_32x32',
'icon_96x96',
'icon_192x192',
'apple_touch_icon',
'apple_touch_icon_72x72',
'apple_touch_icon_76x76',
'apple_touch_icon_114x114',
'apple_touch_icon_120x120',
'apple_touch_icon_144x144',
'apple_touch_icon_152x152',
'apple_touch_icon_180x180',
'apple_touch_icon_precomposed',
'apple_touch_icon_precomposed_72x72',
'apple_touch_icon_precomposed_76x76',
'apple_touch_icon_precomposed_114x114',
'apple_touch_icon_precomposed_120x120',
'apple_touch_icon_precomposed_144x144',
'apple_touch_icon_precomposed_152x152',
'apple_touch_icon_precomposed_180x180',
];
protected $testTag = 'link';
protected $testNameAttribute = 'rel';
protected $testValueAttribute = 'href';
protected function shortcutIconTestValueAttribute() {
return 'href';
}
protected function icon16x16TestOutputXpath() {
return "//link[@rel='icon' and @sizes='16x16']";
}
protected function icon192x192TestOutputXpath() {
return "//link[@rel='icon' and @sizes='192x192']";
}
protected function icon32x32TestOutputXpath() {
return "//link[@rel='icon' and @sizes='32x32']";
}
protected function icon96x96TestOutputXpath() {
return "//link[@rel='icon' and @sizes='96x96']";
}
protected function appleTouchIconPrecomposedTestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and not(@sizes)]";
}
protected function appleTouchIconPrecomposed114x114TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='114x114']";
}
protected function appleTouchIconPrecomposed120x120TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='120x120']";
}
protected function appleTouchIconPrecomposed144x144TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='144x144']";
}
protected function appleTouchIconPrecomposed152x152TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='152x152']";
}
protected function appleTouchIconPrecomposed180x180TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='180x180']";
}
protected function appleTouchIconPrecomposed72x72TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='72x72']";
}
protected function appleTouchIconPrecomposed76x76TestOutputXpath() {
return "//link[@rel='apple-touch-icon-precomposed' and @sizes='76x76']";
}
protected function appleTouchIconTestOutputXpath() {
return "//link[@rel='apple-touch-icon' and not(@sizes)]";
}
protected function appleTouchIcon114x114TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='114x114']";
}
protected function appleTouchIcon120x120TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='120x120']";
}
protected function appleTouchIcon144x144TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='144x144']";
}
protected function appleTouchIcon152x152TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='152x152']";
}
protected function appleTouchIcon180x180TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='180x180']";
}
protected function appleTouchIcon72x72TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='72x72']";
}
protected function appleTouchIcon76x76TestOutputXpath() {
return "//link[@rel='apple-touch-icon' and @sizes='76x76']";
}
protected function maskIconTestTagName() {
return 'mask-icon';
}
protected function shortcutIconTestTagName() {
return 'shortcut icon';
}
}