The Comment blocks test returns 1 fail, 21 exceptions such as:
Undefined index: 1#comment-1 Notice comment.module 1616 comment_load()
All these exceptions are triggered when using clickLink() on a comment link, such as line 1013 in comment.test
$this->clickLink($comment1->subject);
The fragment gets encoded as part of the q variables and interpreted as part of the comment id. The fragment should be removed in clickLink() as the webserver cannot deal with it (only the client's browser can).
Note that I'm able to reproduce this on both debian PHP 5.2.6-1+lenny4 and MAMP PHP 5.2.10.
Comments
Comment #1
scor commentedComment #2
scor commentedor more strictly
Comment #3
scor commentedJust found #671520: Curl and fragment URLs break testing. I suggest to commit the work around present in the attached patch (which disables the fragment before the CURL call), and remove it when the CURL fragment issue has been resolved.
Comment #4
scor commentedmaking the fragment optional in clickLink().
Comment #5
berdirI can confirm that this does fix the issue. While it might not be a proper fix, it's a necessary workaround to have the tests pass again.
Comment #6
dries commentedURL should be written URL instead of url.
Missing space.
Would be good to have some code comments too.
Comment #7
scor commentedHere is a more generic approach, which works for any URL with fragment passed to drupalGet(). $path can contain a fragment and url() is meant to handle it fine, so no need to split it in clickLink(). The work CURL around should only live in drupalGet().
Comment #8
scor commentedfix typo and space.
Comment #9
webchickIck. :\
Committed to HEAD, but let's make sure we get #671520: Curl and fragment URLs break testing fixed so we can remove that hack...
Comment #10
berdirOk, turns out that this triggers other test fails..
There are two tests that use a very special URL that does, beneath other things, also contain an # which needs to be escaped. The above change however strips everything behind the # off. That's not what we want in this case.
I don't see a way to automatically distinguish between these two use cases, any idea?
Comment #11
scor commentedroll back of #8 and fix of #1 upon chx's advice to isolate the fix in the call rather than evil drupalGet().
Comment #12
chx commentedIt's way, way too late to change drupalGet. It's too central and leads to failures :) but fixing clickLink is what this issue is about.
Comment #13
scor commentedSame patch with more comments. This fixes:
Comment #14
webchickOk, let's try this one. Committed to HEAD.