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 {
26 'apple_touch_icon_72x72',
27 'apple_touch_icon_76x76',
28 'apple_touch_icon_114x114',
29 'apple_touch_icon_120x120',
30 'apple_touch_icon_144x144',
31 'apple_touch_icon_152x152',
32 'apple_touch_icon_180x180',
33 'apple_touch_icon_precomposed',
34 'apple_touch_icon_precomposed_72x72',
35 'apple_touch_icon_precomposed_76x76',
36 'apple_touch_icon_precomposed_114x114',
37 'apple_touch_icon_precomposed_120x120',
38 'apple_touch_icon_precomposed_144x144',
39 'apple_touch_icon_precomposed_152x152',
40 'apple_touch_icon_precomposed_180x180',
46 public $test_tag = 'link';
51 public $test_name_attribute = 'rel';
56 public $test_value_attribute = 'href';
61 protected function setUp() {
62 parent::$modules[] = 'metatag_favicons';
67 * Implements {meta_tag_name}_test_value_attribute() for
70 public function shortcut_icon_test_value_attribute() {
75 * Implements {meta_tag_name}_test_output_xpath() for 'icon_16x16',
77 public function icon_16x16_test_output_xpath() {
78 return "//link[@rel='icon' and @sizes='16x16']";
82 * Implements {meta_tag_name}_test_output_xpath() for 'icon_192x192',
84 public function icon_192x192_test_output_xpath() {
85 return "//link[@rel='icon' and @sizes='192x192']";
89 * Implements {meta_tag_name}_test_output_xpath() for 'icon_32x32',
91 public function icon_32x32_test_output_xpath() {
92 return "//link[@rel='icon' and @sizes='32x32']";
96 * Implements {meta_tag_name}_test_output_xpath() for 'icon_96x96',
98 public function icon_96x96_test_output_xpath() {
99 return "//link[@rel='icon' and @sizes='96x96']";
103 * Implements {meta_tag_name}_test_output_xpath() for
104 * 'apple_touch_icon_precomposed',
106 public function apple_touch_icon_precomposed_test_output_xpath() {
107 return "//link[@rel='apple-touch-icon-precomposed' and not(@sizes)]";
111 * Implements {meta_tag_name}_test_output_xpath() for
112 * 'apple_touch_icon_precomposed_114x114',
114 public function apple_touch_icon_precomposed_114x114_test_output_xpath() {
115 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='114x114']";
119 * Implements {meta_tag_name}_test_output_xpath() for
120 * 'apple_touch_icon_precomposed_120x120',
122 public function apple_touch_icon_precomposed_120x120_test_output_xpath() {
123 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='120x120']";
127 * Implements {meta_tag_name}_test_output_xpath() for
128 * 'apple_touch_icon_precomposed_144x144',
130 public function apple_touch_icon_precomposed_144x144_test_output_xpath() {
131 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='144x144']";
135 * Implements {meta_tag_name}_test_output_xpath() for
136 * 'apple_touch_icon_precomposed_152x152',
138 public function apple_touch_icon_precomposed_152x152_test_output_xpath() {
139 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='152x152']";
143 * Implements {meta_tag_name}_test_output_xpath() for
144 * 'apple_touch_icon_precomposed_180x180',
146 public function apple_touch_icon_precomposed_180x180_test_output_xpath() {
147 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='180x180']";
151 * Implements {meta_tag_name}_test_output_xpath() for
152 * 'apple_touch_icon_precomposed_72x72',
154 public function apple_touch_icon_precomposed_72x72_test_output_xpath() {
155 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='72x72']";
159 * Implements {meta_tag_name}_test_output_xpath() for
160 * 'apple_touch_icon_precomposed_76x76',
162 public function apple_touch_icon_precomposed_76x76_test_output_xpath() {
163 return "//link[@rel='apple-touch-icon-precomposed' and @sizes='76x76']";
167 * Implements {meta_tag_name}_test_output_xpath() for 'apple_touch_icon',
169 public function apple_touch_icon_test_output_xpath() {
170 return "//link[@rel='apple-touch-icon' and not(@sizes)]";
174 * Implements {meta_tag_name}_test_output_xpath() for
175 * 'apple_touch_icon_114x114',
177 public function apple_touch_icon_114x114_test_output_xpath() {
178 return "//link[@rel='apple-touch-icon' and @sizes='114x114']";
182 * Implements {meta_tag_name}_test_output_xpath() for
183 * 'apple_touch_icon_120x120',
185 public function apple_touch_icon_120x120_test_output_xpath() {
186 return "//link[@rel='apple-touch-icon' and @sizes='120x120']";
190 * Implements {meta_tag_name}_test_output_xpath() for
191 * 'apple_touch_icon_144x144',
193 public function apple_touch_icon_144x144_test_output_xpath() {
194 return "//link[@rel='apple-touch-icon' and @sizes='144x144']";
198 * Implements {meta_tag_name}_test_output_xpath() for
199 * 'apple_touch_icon_152x152',
201 public function apple_touch_icon_152x152_test_output_xpath() {
202 return "//link[@rel='apple-touch-icon' and @sizes='152x152']";
206 * Implements {meta_tag_name}_test_output_xpath() for
207 * 'apple_touch_icon_180x180',
209 public function apple_touch_icon_180x180_test_output_xpath() {
210 return "//link[@rel='apple-touch-icon' and @sizes='180x180']";
214 * Implements {meta_tag_name}_test_output_xpath() for
215 * 'apple_touch_icon_72x72',
217 public function apple_touch_icon_72x72_test_output_xpath() {
218 return "//link[@rel='apple-touch-icon' and @sizes='72x72']";
222 * Implements {meta_tag_name}_test_output_xpath() for
223 * 'apple_touch_icon_76x76',
225 public function apple_touch_icon_76x76_test_output_xpath() {
226 return "//link[@rel='apple-touch-icon' and @sizes='76x76']";
230 * Implements {meta_tag_name}_test_output_xpath for 'mask-icon'.
232 public function mask_icon_test_tag_name() {
237 * Implements {meta_tag_name}_test_tag_name for 'shortcut icon'.
239 public function shortcut_icon_test_tag_name() {
240 return 'shortcut icon';