metatag_app_links.tags.test 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * @file
  4. * Tests that each of the Metatag App Links tags work correctly.
  5. */
  6. /**
  7. * Tests that each of the Metatag App Links tags work correctly.
  8. */
  9. class MetatagAppLinksTagsTest extends MetatagTagsTestBase {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public static function getInfo() {
  14. return array(
  15. 'name' => 'Metatag tags: App Links',
  16. 'description' => 'Test the App Links meta tags.',
  17. 'group' => 'Metatag',
  18. );
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public $tags = array(
  24. 'al:android:app_name',
  25. 'al:android:class',
  26. 'al:android:package',
  27. 'al:android:url',
  28. 'al:ios:app_name',
  29. 'al:ios:app_store_id',
  30. 'al:ios:url',
  31. 'al:ipad:app_name',
  32. 'al:ipad:app_store_id',
  33. 'al:ipad:url',
  34. 'al:iphone:app_name',
  35. 'al:iphone:app_store_id',
  36. 'al:iphone:url',
  37. 'al:web:should_fallback',
  38. 'al:web:url',
  39. 'al:windows:app_id',
  40. 'al:windows:app_name',
  41. 'al:windows:url',
  42. 'al:windows_phone:app_id',
  43. 'al:windows_phone:app_name',
  44. 'al:windows_phone:url',
  45. 'al:windows_universal:app_id',
  46. 'al:windows_universal:app_name',
  47. 'al:windows_universal:url',
  48. );
  49. /**
  50. * {@inheritdoc}
  51. */
  52. public $test_name_attribute = 'property';
  53. /**
  54. * {@inheritdoc}
  55. */
  56. function setUp(array $modules = array()) {
  57. $modules[] = 'metatag_app_links';
  58. parent::setUp($modules);
  59. }
  60. /**
  61. * {@inheritdoc}
  62. */
  63. public function getTestTagName($tag_name) {
  64. // All of the tags have their underlines replaced with colons.
  65. // Start with the beginning of the string.
  66. $tag_name = str_replace('al_', 'al:', $tag_name);
  67. // The three-ish standard tag names.
  68. $tag_name = str_replace('_app_id', ':app_id', $tag_name);
  69. $tag_name = str_replace('_app_name', ':app_name', $tag_name);
  70. $tag_name = str_replace('_app_store_id', ':app_store_id', $tag_name);
  71. $tag_name = str_replace('_url', ':url', $tag_name);
  72. // One-offs.
  73. $tag_name = str_replace('_class', ':class', $tag_name);
  74. $tag_name = str_replace('_package', ':package', $tag_name);
  75. $tag_name = str_replace('_should_fallback', ':should_fallback', $tag_name);
  76. return $tag_name;
  77. }
  78. }