Skip to content

Instantly share code, notes, and snippets.

@eliza411
Created December 6, 2014 17:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliza411/67d2aa93cfa9a31b65ad to your computer and use it in GitHub Desktop.
Save eliza411/67d2aa93cfa9a31b65ad to your computer and use it in GitHub Desktop.
Behat step for Drupal batch-api support
<?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);
}
}
?>
@eliza411
Copy link
Author

eliza411 commented Dec 6, 2014

@spolischook
Copy link

spolischook commented Aug 25, 2017

Every time when you call find in element you should remember that this method can return null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment