This is a follow-up from #295719: node.test cleanup and #299186: SimpleTest: assertFieldByXPath does not work for selects or textareas with value. When these two were committed, I got two failing tests in the node module.

I tracked this down to assertFieldByXPath() that doesn't work properly with textareas. However, it seems that this is related to the PHP version or perhaps the version of libxml installed on the system.

Consider this very simple example:

<?php
$xml = new SimpleXMLElement('<foo>abc</foo>');
foreach ($xml->xpath('//foo') as $bar) {
    var_dump(isset($bar[0]));
}

On PHP 5.2.0-8+etch11 (Debian) with libxml 2.6.27, it outputs bool(false), but on another system running PHP 5.2.2 (Fedora 7) with libxml 2.6.28 outputs bool(true).

The attached patch appears to fix the problem on my Debian system (I cannot easily test it on the Fedora system). However, my experience with SimpleXML is limited.

Comments

c960657’s picture

Title: SimpleTest: assertFieldByXPath() doesn't in some environments » SimpleTest: assertFieldByXPath() doesn't work in some environments
webchick’s picture

Status: Active » Needs review

Subscribing. Also, this is a patch.

c960657’s picture

StatusFileSize
new1.08 KB

Reroll for HEAD.

Status: Needs review » Needs work

The last submitted patch failed testing.

boombatower’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review
StatusFileSize
new1.02 KB

Chasing HEAD.

To review this, we need a person that experiences this problem (perhaps running Debian Etch) who can verify that it is fixed by the patch, and a person who does not experience this problem who can check that it does not break anything.

c960657’s picture

Well, I guess the testbed robot is an example of the latter (except that it is not a person :-)).

c960657’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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