public function ThunderMetaTagTrait::generateMetaTagConfiguration in Thunder 8.2
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
- 8.3 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
- 8.4 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
- 6.2.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
- 6.0.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::generateMetaTagConfiguration()
- 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\FunctionalJavascriptCode
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;
}