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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | assertFieldByXPath-3.patch | 1.02 KB | c960657 |
| #3 | assertFieldByXPath-2.patch | 1.08 KB | c960657 |
| assertFieldByXPath.patch | 1.03 KB | c960657 |
Comments
Comment #1
c960657 commentedComment #2
webchickSubscribing. Also, this is a patch.
Comment #3
c960657 commentedReroll for HEAD.
Comment #5
boombatower commenteddue to: #74645: modify file_scan_directory to include a regex for the nomask.
Comment #7
c960657 commentedChasing 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.
Comment #8
c960657 commentedWell, I guess the testbed robot is an example of the latter (except that it is not a person :-)).
Comment #9
c960657 commentedThis was fixed in #346529: Failures in node.test with assertFieldByXPath.