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.

Comments

Status:Needs review» Needs work

Making some changes.

Status:Needs work» Needs review
StatusFileSize
new6.35 KB

Just needed $this->elements->xpath() instead of $this->xpath() (recursion heh).

Priority:Normal» Critical

This patch is required for: #297894: Add assertLink and assertNoLink to SimpleTest
which is required for: #296693: Hide empty admin categories
which is required for: #263616: Move SimpleTest out of "Site building"

So I'll mark it as critical.

Status:Needs review» Needs work

Ran 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

Status:Needs work» Needs review
StatusFileSize
new6.35 KB

This should fix the exception mentioned. Still need whole suite to be run.

Ran entire test suite with all passes.

Code looks good to me. Since the test suite still runs to 100% perfecton, this is RTBC.

Status:Needs review» Reviewed & tested by the community

Status:Reviewed & tested by the community» Fixed

Committed to CVS HEAD. Thanks.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.