Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2010 at 09:15 UTC
Updated:
25 Jan 2015 at 16:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pkiraly commentedAppending the test file with some more test cases
Comment #2
chx commentedBrowser based tests are a lot easier to write and port to D7 .
Comment #3
jcfiala commentedThis is really cool, but I'm noticing a problem with it - the xpath throws warnings when it hits paths like //a[@href="http://example.com/s549952LRefyAJT" and text()="s549952M5g5RZzD<script>alert("hi");</script>"]. I think this is because text() is supposed to be searching for *only* text nodes, and by putting the <script> tag inside of the text, it no longer qualifies as a text node.
XML is hard. :)
I'm working on trying to come up with a method to do the tests you want to do, but stop errors from popping up. Well, not errors, warnings.
Comment #4
jcfiala commentedHm. Well, you seem to really need that to fail, because you're testing to see if nothing is found if the link type isn't good. So, I put libxml_use_internal_errors(TRUE) before your call to $this->xpath(), and libxml_use_internal_errors(FALSE) afterwards. That way the warnings we don't want to see, but expect, don't cause us any trouble.
I'm going to include this into the project. Thanks!
Comment #5
jcfiala commentedAnd, might as well set it as fixed. Thanks for the help!
Comment #6
chx commentedComment #8
chx commentedComment #9
boombatower commentedLooks good.
Comment #10
dries commentedThis patch works for me, although it could use a code comment. I had to look up libxml_use_internal_errors() to understand what the patch does, and then had to know Drupal to understand why we're not using a custom error handler. So, can we add a little bit of documentation to describe this test and its implementation? Thanks!
Comment #11
elijah lynn#8: libxml_use_internal_errors.patch queued for re-testing.
Comment #13
chx commented