Created
December 6, 2014 17:40
-
-
Save eliza411/67d2aa93cfa9a31b65ad to your computer and use it in GitHub Desktop.
Behat step for Drupal batch-api support
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 | |
/** | |
* @Given /^I follow meta refresh$/ | |
*/ | |
public function iFollowMetaRefresh() { | |
while ($refresh = $this->getMainContext()->getSession()->getPage()->find('css', 'meta[http-equiv="Refresh"]')) { | |
$content = $refresh->getAttribute('content'); | |
$url = str_replace('0; URL=', '', $content); | |
$this->getMainContext()->getSession()->visit($url); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Every time when you call
find
in element you should remember that this method can return null