Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
From work with testing.drupal.org and looking at some of the hax related to simpletest.test I think we need meta refresh support in the SimpleTest browser. In general this is needed to run any page using the batch API so it would most likely come in to more uses in the future.
The question is how to implement it.
function drupalGet($path, $options = array(), $ = 10) {
$options['absolute'] = TRUE;
// We re-using a CURL connection here. If that connection still has certain
// options set, it might change the GET into a POST. Make sure we clear out
// previous options.
$out = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => url($path, $options), CURLOPT_HEADER => FALSE, CURLOPT_NOBODY => FALSE));
$this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
return $out;
}
should I add something like:
if ($this->parse()) {
$refresh = $this->xpath('//meta[@http-equiv="Refresh"]');
if ($refresh) {
// .... call drupalGet again or something?
}
}
and if so should I call drupalGet again? or somehow allow for support of meta refresh with delay longer then 0? or even allow test to see the page in the middle?
Comment | File | Size | Author |
---|---|---|---|
#14 | simpletest_meta_refresh.patch | 5.36 KB | boombatower |
#13 | simpletest_meta_refresh.patch | 5.1 KB | boombatower |
#12 | simpletest_meta_refresh.patch | 5.09 KB | boombatower |
#10 | simpletest_meta_refresh.patch | 5.07 KB | boombatower |
#7 | simpletest_meta_refresh.patch | 4.99 KB | boombatower |
Comments
Comment #1
boombatower CreditAttribution: boombatower commentedComment #2
boombatower CreditAttribution: boombatower commentedCode like the following would do it, but I'm not sure this is what we want? Seems fine.
Comment #3
boombatower CreditAttribution: boombatower commentedUpdated patch, that also removes hack related to simpletest.test with passes. :)
Comment #4
boombatower CreditAttribution: boombatower commentedUpdated regex to allow for any or no whitespace instead of my [ ]+ space check...heh.
Comment #5
keith.smith CreditAttribution: keith.smith commentedMinor, but huh? Maybe that "of" should be "or", perhaps?
Comment #6
boombatower CreditAttribution: boombatower commentedchx:
* Named sub-pattern.
* Changed urldecode -> decode_entities.
Comment #7
boombatower CreditAttribution: boombatower commented#5 fixed
Comment #8
chx CreditAttribution: chx commentedGood work!
Comment #9
c960657 CreditAttribution: c960657 commentedAFAICT this does a case-sensitive search for "Refresh", but the http-equiv attribute is case-insentive (according to the section 7.4.4 of the HTML spec).
Comment #10
boombatower CreditAttribution: boombatower commentedThis is how ugly it looks after adding that...since we are really just trying to support Drupal not sure if we want this.
turned into:
plus made regex case insentive, but that was easy...just added modifier (i).
If not use #7.
Comment #11
Dries CreditAttribution: Dries commentedLet's go with #7 but add a comment about how to use it (i.e. case-sensitive).
Comment #12
boombatower CreditAttribution: boombatower commentedHow about this.
Comment #13
boombatower CreditAttribution: boombatower commentedslight comment change.
Comment #14
boombatower CreditAttribution: boombatower commentedAdded comments after webchick reviewed in IRC.
Comment #15
webchickCommitted! Thanks. :)
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.