Commit 78abdf99 authored by Damien McKenna's avatar Damien McKenna Committed by Damien McKenna
Browse files

Issue #3270984 by DamienMcKenna: Test meta tags don't work.

parent 3baa079c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Metatag 7.x-1.x-dev, xxxx-xx-xx
#3106872 by DamienMcKenna: Change uses of http:// to https://.
#3243694 by DamienMcKenna, Kasey_MK: Avoid similar-sounding links with different
  purposes.
#3270984 by DamienMcKenna: Test meta tags don't work.


Metatag 7.x-1.28, 2021-07-12
+40 −0
Original line number Diff line number Diff line
<?php

/**
 * @file
 * Test the test meta tags from the Metatag Test module.
 */

/**
 * Test the test meta tags from the Metatag Test module.
 */
class MetatagTestTestTestMetatags extends MetatagTagsTestBase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'Test metatags',
      'description' => "Tests the test meta tags from the metatag_test module.",
      'group' => 'Metatag',
      'dependencies' => array('ctools', 'devel', 'token'),
    );
  }

  /**
   * {@inheritdoc}
   */
  public $tags = array(
    'test:foo',
    'test:multifoo',
  );

  /**
   * {@inheritdoc}
   */
  public function getTestTagName($tag_name) {
    return str_replace('_', ':', $tag_name);
  }

}
+3 −0
Original line number Diff line number Diff line
@@ -6,3 +6,6 @@ core = 7.x
hidden = TRUE

dependencies[] = metatag:metatag

; Custom tests for this module.
files[] = MetatagTestTestTestMetatags.test
+9 −1
Original line number Diff line number Diff line
@@ -59,12 +59,20 @@ function metatag_test_metatag_info() {
    ),
  );

  $info['test:foo'] = array(
  $info['tags']['test:foo'] = array(
    'label' => t('Foo meta tag'),
    'description' => t('Testing metatag.'),
    'class' => 'DrupalTextMetaTag',
    'group' => 'testing',
  );

  $info['tags']['test:multifoo'] = array(
    'label' => t('Multi foo meta tag'),
    'description' => t('Testing metatag.'),
    'class' => 'DrupalTextMetaTag',
    'group' => 'testing',
    'multiple' => TRUE,
  );

  return $info;
}