public function SocialMinkContext::assertRegionHeading in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 8.3 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 8.4 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 8.5 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 8.6 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 8.7 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 8.8 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 10.3.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 10.0.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
- 10.1.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::assertRegionHeading()
@override MinkContext::assertRegionHeading()
Makes the step case insensitive.
File
- tests/
behat/ features/ bootstrap/ SocialMinkContext.php, line 28
Class
- SocialMinkContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function assertRegionHeading($heading, $region) {
$regionObj = $this
->getRegion($region);
foreach (array(
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
) as $tag) {
$elements = $regionObj
->findAll('css', $tag);
if (!empty($elements)) {
foreach ($elements as $element) {
if (trim(strtolower($element
->getText())) === strtolower($heading)) {
return;
}
}
}
}
throw new \Exception(sprintf('The heading "%s" was not found in the "%s" region on the page %s', $heading, $region, $this
->getSession()
->getCurrentUrl()));
}