Add SimpleTest user agent information to drupal_http_request
boombatower - May 20, 2008 - 20:05
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | simpletest.module |
| Category: | task |
| Priority: | critical |
| Assigned: | boombatower |
| Status: | closed |
Description
This issue has been run into multiple times and even discussed several times with nothing done about it.
Internal Drupal functions like xmlrpc call drupal_http_request which makes an HTTP request. When tests try to call these functions they don't pass the SimpleTest user-agent (database-prefix) information like the cURL handler does.
This broke a number of tests that used to pass before the database-prefixing was implemented.
To fix this a patch similar to simpletest_review_blogapi_xmlrpc.patch at http://drupal.org/node/245955 should be created. Instead of that patch which is specific for xmlrpc stuff a more broad catch-all patch should be applied.
I have create a patch that fixes the issue.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| add_simpletest_user_agent.patch | 1.06 KB | Ignored | None | None |

#1
$simpletest_ua_keythis is not used in core.#2
I was wondering about that since I remember discussion about it not being necessary.
#3
Updated patch. Previous one still worked since it just ignored the extra key. :)
#4
I'd like to see a bit more code comments in the code. We should explain _why_ this is needed. Thanks for your hard work. :)
#5
Added more comments.
#6
I still think it needs more documentation. Why do we have to use headers instead of, say, a database variable. I know the answer, but it would be good to explain this. You added the "what", but the "why" and "how" is still missing from the documentation. We're almost there ...
#7
Probably a good idea since it is a rather odd bit of code.
#8
I think that has been reviewed and it just needed comments...
#9
This is showing up in another issue so it would be nice to get it resolved.
#10
For what is worth, this looks good now.
#11
This fixes http://drupal.org/node/259988 - so confirming the RTBC and marking as critical.
#12
This should fix #249154: Aggregator tests fail when existing content is present. as well.
#13
Note that this fixes xmlrpc tests too (#268063: Move includes/tests to simpletest/tests & provide hidden .info propery).
#14
Yea! Three tests!
#15
Committed to CVS HEAD. Thanks.
#16
Automatically closed -- issue fixed for two weeks with no activity.