Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
A number of tests and internal functions use xpath to make assertions. This is a very powerful feature, but is not documented or exposed in any way.
This patch adds an xpath
method to DrupalWebTestCase so that it can be both documented, used consistently, and enclosed in the proper $this->parse()
condition.
The patch also reactors existing tests and internal code that uses xpath. Changing $this->elements->xpath(...)
becomes $this->xpath(...)
.
I have not tested this patch and will get back to it, but I have to leave at the moment so I figured I would post what I have.
Comment | File | Size | Author |
---|---|---|---|
#5 | simpletest_xpath.patch | 6.35 KB | boombatower |
#2 | simpletest_xpath.patch | 6.35 KB | boombatower |
simpletest_xpath.patch | 6.34 KB | boombatower | |
Comments
Comment #1
boombatower CreditAttribution: boombatower commentedMaking some changes.
Comment #2
boombatower CreditAttribution: boombatower commentedJust needed
$this->elements->xpath()
instead of$this->xpath()
(recursion heh).Comment #3
boombatower CreditAttribution: boombatower commentedThis patch is required for: #297894: Add assertLink and assertNoLink to SimpleTest
which is required for: #296693: Restrict access to empty top level administration pages
which is required for: #263616: Move SimpleTest out of "Site building"
So I'll mark it as critical.
Comment #4
boombatower CreditAttribution: boombatower commentedRan tests on changed/effected code and they all pass except two with exception. If someone wants to run on all tests that would be great.
SimpleTest functionality: 43 passes, 0 fails, 2 exceptions
Drupal HTTP request: 4 passes, 0 fails, 2 exceptions
Comment #5
boombatower CreditAttribution: boombatower commentedThis should fix the exception mentioned. Still need whole suite to be run.
Comment #6
boombatower CreditAttribution: boombatower commentedRan entire test suite with all passes.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedCode looks good to me. Since the test suite still runs to 100% perfecton, this is RTBC.
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedComment #9
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.