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.
When running the Drupal HTTP request
test an exception in generated. That can be removed by adding @
to parse_url()
.
Since the code checks to make sure that it parsed the URL successfully and returns error messages anyway it would seem to make sense that the function would mask the errors triggered.
Updated test to include actual page fetch test.
Comment | File | Size | Author |
---|---|---|---|
#20 | drupal_http_request.test_2.patch | 1.11 KB | mustafau |
#12 | drupal_http_request.test.patch | 3.94 KB | boombatower |
#10 | 295564-drupal-http-request.test.patch | 3.75 KB | Damien Tournoud |
#9 | 295564-drupal-http-request.test.patch | 3.3 KB | Damien Tournoud |
#7 | drupal_http_request.test.patch | 1.62 KB | boombatower |
Comments
Comment #1
obsidiandesign CreditAttribution: obsidiandesign commentedIs this a different approach/related to #283806: Notice appears when drupal_http_request called with an invalid URL? I found both when searching for information about the Drupal HTTP request test.
Comment #2
boombatower CreditAttribution: boombatower commentedI've commented on the other issue.
Comment #3
catchCrtical since this is now our only remaining test with any kind of breakage, review forthcoming.
Comment #4
catchMakes sense to me to rely on our internal error handling and suppress the php warnings in the function call rather than just the test. This removes the exception, adds an extra test, lovely.
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedPlease we can do better than that:
Comment #6
boombatower CreditAttribution: boombatower commentedMeaning get rid of !== FALSE? The reason that is there is I'm not sure if assertTrue is type strict. If not that strpos returning 0 would fail even thought that is success.
Since the page should never have the as the first character we could consider that a fail anyway. I'll remove the !== FALSE.
Comment #7
boombatower CreditAttribution: boombatower commentedUpdated, per #5-6.
Comment #8
boombatower CreditAttribution: boombatower commentedStill passes and already reviewed per #4.
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedI should have been clearer. I meant that we have a whole facility for asserting things on pages with DrupalWebTestCase, we should use it.
Comment #10
Damien Tournoud CreditAttribution: Damien Tournoud commentedOups, here is a new version that fixes an exception in DrupalWebTestCase::getUrl().
Comment #11
boombatower CreditAttribution: boombatower commentedI realized that, but didn't use it since you can't without setting the content. Wasn't sure that was something we wanted to do.
I like what you've done, I'll take a look at it shortly.
Comment #12
boombatower CreditAttribution: boombatower commentedI like that you can set the content now, it has grown on me after thinking about it. I have added a more detailed description of the uses for drupalSetContent() and fixed a formatting issue related to the function indentation.
The test still passes and we both have reviewed this format.
Comment #13
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #14
boombatower CreditAttribution: boombatower commentedThat means we are at 100% pass!
Comment #15
webchickYYYYAAAAAAAAAYYYYYYYYYY!!!!!!!!!
Best. Day. EVER! :)
Comment #16
mustafau CreditAttribution: mustafau commentedThe tests committed with this patch were reverted by the DB:TNG patch. See: http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/simpletest/tests/c...
Comment #17
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #18
boombatower CreditAttribution: boombatower commentedDoesn't it just need to be reapplied...not worked on?
Comment #19
Dries CreditAttribution: Dries commentedDoesn't apply.
Comment #20
mustafau CreditAttribution: mustafau commentedRe-roll.
Comment #21
boombatower CreditAttribution: boombatower commentedTest still passes after applicate, as before...looks good.
Comment #22
boombatower CreditAttribution: boombatower commentededit: wrong issue.
Comment #23
boombatower CreditAttribution: boombatower commentedComment #24
Dries CreditAttribution: Dries commentedCode no longer applies.
Comment #25
mustafau CreditAttribution: mustafau commentedPatch at #20 still applies.
Comment #26
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #27
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.