protected function ThunderMetaTagTrait::checkMetaTag in Thunder 6.1.x
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::checkMetaTag()
- 8.2 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::checkMetaTag()
- 8.3 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::checkMetaTag()
- 8.4 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::checkMetaTag()
- 6.2.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::checkMetaTag()
- 6.0.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::checkMetaTag()
Check single meta tag on page.
Parameters
string $name: Meta tag name.
string $value: Meta tag value.
1 call to ThunderMetaTagTrait::checkMetaTag()
- ThunderMetaTagTrait::checkMetaTags in tests/
src/ FunctionalJavascript/ ThunderMetaTagTrait.php - Verify that meta tag values defined in configuration are properly set.
File
- tests/
src/ FunctionalJavascript/ ThunderMetaTagTrait.php, line 64
Class
- ThunderMetaTagTrait
- Trait for manipulation of meta tag configuration and meta tags on page.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
protected function checkMetaTag($name, $value) {
$htmlValue = htmlentities($value);
$checkXPath = "@content='{$htmlValue}'";
if (strpos($value, 'LIKE:') === 0) {
$valueToCheck = substr($htmlValue, strlen('LIKE:'));
$checkXPath = "contains(@content, '{$valueToCheck}')";
}
$this
->assertSession()
->elementExists('xpath', "//head/meta[(@name='{$name}' or @property='{$name}') and {$checkXPath}]");
}