You are here

public function ThunderMetaTagTrait::generateMetaTagConfiguration in Thunder 8.5

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
  2. 8.3 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
  3. 8.4 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
  4. 6.2.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()

Generate meta tag configuration.

Parameters

array $configuration: Meta tag configuration.

Return value

array Generated meta tag configuration.

2 calls to ThunderMetaTagTrait::generateMetaTagConfiguration()
MetaInformationTest::testArticleMetaTags in tests/src/FunctionalJavascript/MetaInformationTest.php
Test Meta Tag default configuration and custom configuration for article.
ModuleIntegrationTest::testFacebookMetaTags in tests/src/FunctionalJavascript/ModuleIntegrationTest.php
Testing integration of "metatag_facebook" module.

File

tests/src/FunctionalJavascript/ThunderMetaTagTrait.php, line 87

Class

ThunderMetaTagTrait
Trait for manipulation of meta tag configuration and meta tags on page.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function generateMetaTagConfiguration(array $configuration) {
  $metaTagConfigs = [];
  foreach ($configuration as $config) {
    $metaTagConfigs = array_merge($metaTagConfigs, $config);
  }
  foreach ($metaTagConfigs as $metaTagName => $metaTagValue) {
    if ($metaTagValue === '[random]') {
      $metaTagConfigs[$metaTagName] = $this
        ->getRandomGenerator()
        ->word(10);
    }
  }
  return $metaTagConfigs;
}