\Drupal\field_ui\Tests\FieldUiTestBase::fieldUIAddNewField()
\Drupal\field_ui\Tests\FieldUiTestBase::fieldUIAddExistingField()

Every $this->assertFieldByXPath() is fail, because the XPath is wrong.
Therefore only the first field name is collected.

Comments

sweetchuck’s picture

StatusFileSize
new1.44 KB

This patch is tested with PHP 5.5.5

chx’s picture

Status: Active » Reviewed & tested by the community

Nice catch!

chx’s picture

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

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

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

Status: Fixed » Closed (fixed)

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

pfrenssen’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Closed (fixed) » Patch (to be ported)

This also occurs on 7.x when testing with PHP 5.5.15.

$ drush test-run FieldUIManageFieldsTestCase --uri=http://paddle.local
Starting test FieldUIManageFieldsTestCase.
Manage fields 52 passes, 2 fails, 0 exceptions, and 14 debug messages
Test FieldUITestCase->fieldUIAddNewField() failed: Field was created and appears in the overview page. in /home/pieter/v/paddle/build/modules/field_ui/field_ui.test on line 73
Test FieldUITestCase->fieldUIAddExistingField() failed: Field was created and appears in the overview page. in /home/pieter/v/paddle/build/modules/field_ui/field_ui.test on line 104
pfrenssen’s picture

Status: Patch (to be ported) » Needs review
Issue tags: +PHP 5.5
StatusFileSize
new2.01 KB

I tried a direct port of the 8.x patch but it failed because the XPath expression yielded a table cell containing the text "No fields are present yet.". I have modified the XPath to accommodate for this.

Tests are now green on PHP 5.5.15:

$ drush test-run FieldUIManageFieldsTestCase,FieldUIManageDisplayTestCase,FieldUIAlterTestCase --uri=http://paddle.local
Starting test FieldUIManageFieldsTestCase. 
Manage fields 186 passes, 0 fails, 0 exceptions, and 50 debug messages
No leftover tables to remove.
No temporary directories to remove.
Removed 1 test result.
 Group  Class  Name 

Starting test FieldUIManageDisplayTestCase.
Manage display 83 passes, 0 fails, 0 exceptions, and 33 debug messages
No leftover tables to remove.
No temporary directories to remove.
Removed 1 test result.
 Group  Class  Name 

Starting test FieldUIAlterTestCase.
Widget customization 18 passes, 0 fails, 0 exceptions, and 5 debug messages
No leftover tables to remove.
No temporary directories to remove.
Removed 1 test result.
 Group  Class  Name
lokapujya’s picture

RTBC, but why did it work prior to PHP5.5? was the [1] ignored by prior versions?

lokapujya’s picture

What I asked above is very unlikely; I doubt that xpath changed positional predicates. Probably php5.5 is changing the document?

lokapujya’s picture

Also, the fix used in D8 also works in D7 since the labels are always in the first column. I tried it.
//tr/td[1]

Don't know why pfrenssen was getting "No fields are present yet." But, that seems like a different problem.

So, shoudn't we just use the same fix that was used for D8?

devin carlson’s picture

StatusFileSize
new1.23 KB

A straight backport of #1.

I'm not sure how this currently passes on Drupal.org as I see this with a fresh install of D7 regardless of the version of PHP used.

  • Dries committed c391de1 on 8.3.x
    Issue #2125725 by Sweetchuck: Wrong XPath query in FieldUiTestBase.php.
    

  • Dries committed c391de1 on 8.3.x
    Issue #2125725 by Sweetchuck: Wrong XPath query in FieldUiTestBase.php.
    

  • Dries committed c391de1 on 8.4.x
    Issue #2125725 by Sweetchuck: Wrong XPath query in FieldUiTestBase.php.
    

  • Dries committed c391de1 on 8.4.x
    Issue #2125725 by Sweetchuck: Wrong XPath query in FieldUiTestBase.php.
    
poker10’s picture

Version: 7.x-dev » 8.0.x-dev
Status: Needs review » Fixed

Thanks for working on this. Most recent Drupal 7 versions were passing tests even on PHP 5.5, so I think this is no longer an issue for Drupal 7. Therefore moving back to Drupal 8 as Fixed, so that credits are assigned correctly.

If this is still an issue on D7 on one of the supported PHP versions (5.6+), feel free to create a new issue. However, Drupal 7 GitlabCI pipelines are green on all PHP versions, see: https://git.drupalcode.org/project/drupal/-/pipelines/148241, so in such case we would need a detailed steps to reproduce the issue. Thanks!

Status: Fixed » Closed (fixed)

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