Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / modules / contrib / metatag / metatag_app_links / src / Tests / MetatagAppLinksTagsTest.php
1 <?php
2
3 namespace Drupal\metatag_app_links\Tests;
4
5 use Drupal\metatag\Tests\MetatagTagsTestBase;
6
7 /**
8  * Tests that each of the App Links tags work correctly.
9  *
10  * @group metatag
11  */
12 class MetatagAppLinksTagsTest extends MetatagTagsTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   private $tags = [
18     'al_android_app_name',
19     'al_android_class',
20     'al_android_package',
21     'al_android_url',
22     'al_ios_app_name',
23     'al_ios_app_store_id',
24     'al_ios_url',
25     'al_ipad_app_name',
26     'al_ipad_app_store_id',
27     'al_ipad_url',
28     'al_iphone_app_name',
29     'al_iphone_app_store_id',
30     'al_iphone_url',
31     'al_web_should_fallback',
32     'al_web_url',
33     'al_windows_app_id',
34     'al_windows_app_name',
35     'al_windows_phone_app_id',
36     'al_windows_phone_app_name',
37     'al_windows_phone_url',
38     'al_windows_universal_app_id',
39     'al_windows_universal_app_name',
40     'al_windows_universal_url',
41     'al_windows_url',
42   ];
43
44   /**
45    * {@inheritdoc}
46    */
47   private $testNameAttribute = 'property';
48
49   /**
50    * {@inheritdoc}
51    */
52   protected function setUp() {
53     parent::$modules[] = 'metatag_app_links';
54     parent::setUp();
55   }
56
57   /**
58    * Each of these meta tags has a different tag name vs its internal name.
59    */
60   private function getTestTagName($tag_name) {
61     $tag_name = str_replace('al_android_', 'al:android:', $tag_name);
62     $tag_name = str_replace('al_ios_', 'al:ios:', $tag_name);
63     $tag_name = str_replace('al_ipad_', 'al:ipad:', $tag_name);
64     $tag_name = str_replace('al_iphone_', 'al:iphone:', $tag_name);
65     $tag_name = str_replace('al_web_', 'al:web:', $tag_name);
66     // Run the Windows subtype replacements first so that the generic Windows
67     // one can still work.
68     $tag_name = str_replace('al_windows_phone_', 'al:windows_phone:', $tag_name);
69     $tag_name = str_replace('al_windows_universal_', 'al:windows_universal:', $tag_name);
70     $tag_name = str_replace('al_windows_', 'al:windows:', $tag_name);
71     return $tag_name;
72   }
73
74 }