Commit b5ff191c authored by Anton Shubkin's avatar Anton Shubkin Committed by Damien McKenna
Browse files

Issue #3110152 by DamienMcKenna, antongp: testTagsArePresent() and...

Issue #3110152 by DamienMcKenna, antongp: testTagsArePresent() and testTagsInputOutput() methods of the MetatagTagsTestBase class do not loop through child classes $tags property; updated all tests as necessary.
parent 56162d0b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ By DamienMcKenna: Minor code readability tweak.
#2993991 by DamienMcKenna, jcnventura, raphaeltbm, Geolim4, SteffenR, xurubo93,
  GuillaumeDuveau, joehuggans, mmaldonado: Metatag_hreflang - duplicate
  alternate hreflang meta.
#3110152 by DamienMcKenna, antongp: testTagsArePresent() and
  testTagsInputOutput() methods of the MetatagTagsTestBase class do not loop
  through child classes $tags property; updated all tests as necessary.


Metatag 8.x-1.11, 2019-12-20
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ class MetatagAppLinksTagsTest extends MetatagTagsTestBase {
  /**
   * {@inheritdoc}
   */
  private $tags = [
  protected $tags = [
    'al_android_app_name',
    'al_android_class',
    'al_android_package',
@@ -44,7 +44,7 @@ class MetatagAppLinksTagsTest extends MetatagTagsTestBase {
  /**
   * {@inheritdoc}
   */
  private $testNameAttribute = 'property';
  protected $testNameAttribute = 'property';

  /**
   * {@inheritdoc}
@@ -57,7 +57,7 @@ class MetatagAppLinksTagsTest extends MetatagTagsTestBase {
  /**
   * Each of these meta tags has a different tag name vs its internal name.
   */
  private function getTestTagName($tag_name) {
  protected function getTestTagName($tag_name) {
    $tag_name = str_replace('al_android_', 'al:android:', $tag_name);
    $tag_name = str_replace('al_ios_', 'al:ios:', $tag_name);
    $tag_name = str_replace('al_ipad_', 'al:ipad:', $tag_name);
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ class MetatagDublinCoreTagsTest extends MetatagTagsTestBase {
  /**
   * {@inheritdoc}
   */
  private $tags = [
  protected $tags = [
    'dcterms_contributor',
    'dcterms_coverage',
    'dcterms_creator',
@@ -43,7 +43,7 @@ class MetatagDublinCoreTagsTest extends MetatagTagsTestBase {
  /**
   * Each of these meta tags has a different tag name vs its internal name.
   */
  private function getTestTagName($tag_name) {
  protected function getTestTagName($tag_name) {
    return str_replace('_', '.', $tag_name);
  }

+11 −11
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\Tests\metatag_dc_advanced\Functional;

use Drupal\Tests\metatag\Functional\MetatagTagsTestBase;
use Symfony\Component\DependencyInjection\Container;

/**
 * Tests that each of the Dublin Core Advanced tags work correctly.
@@ -14,7 +15,7 @@ class MetatagDublinCoreAdvancedTagsTest extends MetatagTagsTestBase {
  /**
   * {@inheritdoc}
   */
  private $tags = [
  protected $tags = [
    'dcterms_abstract',
    'dcterms_access_rights',
    'dcterms_accrual_method',
@@ -57,16 +58,6 @@ class MetatagDublinCoreAdvancedTagsTest extends MetatagTagsTestBase {
    'dcterms_valid',
  ];

  /**
   * {@inheritdoc}
   */
  private $testTag = 'meta';

  /**
   * {@inheritdoc}
   */
  private $testNameAttribute = 'property';

  /**
   * {@inheritdoc}
   */
@@ -75,4 +66,13 @@ class MetatagDublinCoreAdvancedTagsTest extends MetatagTagsTestBase {
    parent::setUp();
  }

  /**
   * Each of these meta tags has a different tag name vs its internal name.
   */
  protected function getTestTagName($tag_name) {
    $tag_name = str_replace('dcterms_', '', $tag_name);
    $tag_name = lcfirst(Container::camelize($tag_name));
    return 'dcterms.' . $tag_name;
  }

}
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ class MetatagFacebookTagsTest extends MetatagTagsTestBase {
  /**
   * {@inheritdoc}
   */
  private $tags = [
  protected $tags = [
    'fb_admins',
    'fb_app_id',
    'fb_pages',
@@ -23,7 +23,7 @@ class MetatagFacebookTagsTest extends MetatagTagsTestBase {
  /**
   * {@inheritdoc}
   */
  private $testNameAttribute = 'property';
  protected $testNameAttribute = 'property';

  /**
   * {@inheritdoc}
@@ -36,7 +36,7 @@ class MetatagFacebookTagsTest extends MetatagTagsTestBase {
  /**
   * Each of these meta tags has a different tag name vs its internal name.
   */
  private function getTestTagName($tag_name) {
  protected function getTestTagName($tag_name) {
    $tag_name = str_replace('fb_', 'fb:', $tag_name);
    return $tag_name;
  }
Loading