Noticed on slave #4 (using PHP 5.2.0) we had a failure in each the node preview and node edit tests. I couldn't duplicate the failures on my install with PHP 5.2.4. The line of failure was:
$this->assertFieldByName('body', '<!--break-->' . $edit['body'], t('Body field displayed.'));
and
$this->assertFieldByName('body', '<!--break-->' . $edit['body'], t('Body field displayed.'));

Did lots of debugging ito assertFieldByXPath (used by assertFieldByName), and discovered this logic for textareas:

          elseif (isset($field[0]) && $field[0] == $value) {
             // Text area with correct text.
             $found = TRUE;
           }

My inclination is that on the older version of PHP using $field[0] is returning the first character of the textarea, so trying to compare it to $value fails. Patch changes the logic to:

          elseif ((string) $field == $value) {
             // Text area with correct text.
             $found = TRUE;
           }

Boombatower confirmed that this fixes the failures on slave #4. Tests still pass for me on my local. This is critical as it is the only blocker from getting testing bot running again.

CommentFileSizeAuthor
HEAD-BROKEN-assertFieldByXPath.patch706 bytesdave reid

Comments

boombatower’s picture

Status: Needs review » Reviewed & tested by the community

After confirming our fix on #4 by running all tests and on Dave's machine all seems well.

dave reid’s picture

Status: Reviewed & tested by the community » Needs review

I also confirmed this code fails when it should. I changed the line in node.test to:
$this->assertFieldByName('body', '<!-I_FAIL-break-->' . $edit['body'], t('Body field displayed.'));

The assertion failed as expected with the patch.

dave reid’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! :)

Status: Fixed » Closed (fixed)

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