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.
Currently if the --url argument is set to an https URL it is ignored and http is used instead.
Comment | File | Size | Author |
---|---|---|---|
#9 | 648268-run-tests-https.patch | 1.72 KB | boombatower |
#1 | 648268-run-tests-https.patch | 1.17 KB | boombatower |
Comments
Comment #1
boombatower CreditAttribution: boombatower commentedComment #2
carlos8f CreditAttribution: carlos8f commentedCurious what $_SERVER variables you intend this to fix. I can't think of any offhand that include the scheme in them.
I think 'work with https' is a little misleading, since the script will work, but the environment variables won't be simulated.
I'm on crack. Are you, too?
Comment #3
boombatower CreditAttribution: boombatower commentedThis only works if the server is actually running https://.
Problem is if I do:
All the tests will instead use http://example.com/.
This is due to SimpleTest which currently uses the equivalent of url('', array('absolute' => TRUE));.
Which means, if I run the tests via web interface on a box with https:// enabled it will work fine on https://, but since run-tests.sh is run from command line it depends on --url and sadly interprets it wrong.
Comment #4
boombatower CreditAttribution: boombatower commentedAs for the for loop, that was determined necessary when I wrote the patch with chx that added: modules/simpletest/tests/https.php.
Comment #5
carlos8f CreditAttribution: carlos8f commentedIf I'm understanding this right, you are intending on having *all* the drupalGet()'s in tests use HTTPS by manipulating the --url arg. Is that right?
I would then think this is a new feature, since as far as I can tell --url is currently focused on targeting a specific Drupal site. The docs could then use an update:
You could add something to this explaining the ability to use HTTPS for all the tests. Alternatively, introduce an --https flag which could add this feature. Also,
More specifically, you will need to specify the path.
Anyway, I hope this makes sense and doesn't make me seem like a bike-shedding fool :)
Comment #6
boombatower CreditAttribution: boombatower commentedLets investigate if the argument is necessary or not, but otherwise seems be both agree code is fine.
Comment #7
carlos8f CreditAttribution: carlos8f commentedYes, the code is OK although the help text needs a mention of the ability to run tests in https. A small comment on the purpose of the foreach loop on $_SERVER would also be nice.
Comment #8
carlos8f CreditAttribution: carlos8f commentedComment #9
boombatower CreditAttribution: boombatower commentedComment #10
carlos8f CreditAttribution: carlos8f commentedLooks good.
Comment #11
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!