Created
April 24, 2016 20:32
-
-
Save discipolo/ac82645632e427d3fb78c8578bfb865a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @Then /^(?:|I )should see the following in the repeated "(?P<element>[^"]*)" element within the context of the "(?P<parentElement>[^"]*)" element | |
*/ | |
public function assertRepeatedElementContainsText(TableNode $table, $element, $parentElement) | |
{ | |
$parent = $this->getSession()->getPage()->findAll('css', $parentElement); | |
foreach ($table->getHash() as $n => $repeatedElement) { | |
$child = $parent[$n]; | |
\PHPUnit_Framework_Assert::assertEquals( | |
$child->find('css', $element)->getText(), | |
$repeatedElement['text'] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment