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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boombatower’s picture

Status: Needs review » Needs work

Making some changes.

boombatower’s picture

Status: Needs work » Needs review
FileSize
6.35 KB

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

boombatower’s picture

Priority: Normal » Critical
boombatower’s picture

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

boombatower’s picture

Status: Needs work » Needs review
FileSize
6.35 KB

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

boombatower’s picture

Ran entire test suite with all passes.

moshe weitzman’s picture

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

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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