Skip to content

Commit

Permalink
The assertNotRegionElementText() method is now included in the drupal…
Browse files Browse the repository at this point in the history
…-extension, though somehow its counterpart assertRegionElementText() is not.
  • Loading branch information
becw committed Aug 9, 2016
1 parent c02a4cd commit 135d94e
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/Palantirnet/PalantirBehatExtension/Context/MarkupContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,40 +79,6 @@ public function assertRegionElementText($text, $tag, $region)
}//end assertRegionElementText()


/**
* Test for absence of a tag containing some text.
*
* @Then I should not see :text in the :tag element in the :region( region)
*
* @param string $text The text to look for.
* @param string $tag A CSS selector.
* @param string $region A region name from the behat config.
*
* @return void
*/
public function assertNotRegionElementText($text, $tag, $region)
{
throw new NotUpdatedException('Method not yet updated for Drupal 8.');

$regionObj = $this->getRegion($region);
$results = $regionObj->findAll('css', $tag);

$found = false;
if (empty($results) === false) {
foreach ($results as $result) {
if ($result->getText() === $text) {
$found = true;
}
}
}

if ($found === true) {
throw new \Exception(sprintf('The text "%s" was found in the "%s" element in the "%s" region on the page %s', $text, $tag, $region, $this->getSession()->getCurrentUrl()));
}

}//end assertNotRegionElementText()


/**
* Validate that a particular field label appears on the page.
*
Expand Down

0 comments on commit 135d94e

Please sign in to comment.