Problem/Motivation

In order to fix tests/src/Functional/ExamplesTest.php, related submodules' tests, deprecation notices, and coding standards should be fixed as well.

Testing modules examples/tests/
E.................................................... 53 / 53 (100%)

There was 1 error:

1) Drupal\Tests\examples\Functional\ExamplesTest::testExampleToolbar
Behat\Mink\Exception\ExpectationException: Current response status code is 500, but 200 expected.

vendor/behat/mink/src/WebAssert.php:768
vendor/behat/mink/src/WebAssert.php:130
examples/tests/src/Functional/ExamplesTest.php:34

ERRORS!
Tests: 53, Assertions: 122, Errors: 1.

Proposed resolution

Bringing code from patches of #3103548: Tidy up tablesort_example and tour_example, #3103551: Tidy up testing_example and #3092947: Getting error when module is enabled., and fix submodules: node_type_example, cache_example's tests, deprecation notices, and coding standards, to make a big patch.

Submodules get involved:

  • cache_example
  • node_type_example
  • tablesort_example
  • testing_example
  • tour_example
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jungle created an issue. See original summary.

jungle’s picture

Assigned: jungle » Unassigned
Status: Active » Needs review
FileSize
14.6 KB
marvil07’s picture

Assigned: Unassigned » marvil07
FileSize
3.59 KB

I found that this patch contain some fixes for the Examples.Drupal\Tests\node_type_example\Functional\NodeTypeExampleTest.Drupal\Tests\node_type_example\Functional\NodeTypeExampleTest failed test errors:

  5x: Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting. The uid field on the node.locked_content_type.default form display is missing it. This BC layer will be removed before 9.0.0. See https://www.drupal.org/node/2863188
    2x in NodeTypeExampleTest::testUninstallReinstall from Drupal\Tests\node_type_example\Functional
    1x in NodeTypeExampleTest::testNodeTypeExample from Drupal\Tests\node_type_example\Functional
    1x in NodeTypeExampleTest::testNodeTypes from Drupal\Tests\node_type_example\Functional
    1x in NodeTypeExampleTest::testNodeCreation from Drupal\Tests\node_type_example\Functional

  5x: Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting. The uid field on the node.basic_content_type.default form display is missing it. This BC layer will be removed before 9.0.0. See https://www.drupal.org/node/2863188
    2x in NodeTypeExampleTest::testUninstallReinstall from Drupal\Tests\node_type_example\Functional
    1x in NodeTypeExampleTest::testNodeTypeExample from Drupal\Tests\node_type_example\Functional
    1x in NodeTypeExampleTest::testNodeTypes from Drupal\Tests\node_type_example\Functional
    1x in NodeTypeExampleTest::testNodeCreation from Drupal\Tests\node_type_example\Functional

  3x: Support for asserting against non-boolean values in ::assertTrue is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use a different assert method, for example, ::assertNotEmpty(). See https://www.drupal.org/node/3082086
    3x in NodeTypeExampleTest::testNodeTypes from Drupal\Tests\node_type_example\Functional

Here I am attaching a modified (mainly using interfaces instead of base classes for checks) subset of the previous patch to fix the mentioned failures.
If testbot reports that the mentioned errors are not present anymore, I will add it.

Other hunks may still be useful from the previous patch.
Not providing and interdiff, since the new patch is just a subset.

marvil07’s picture

FileSize
3.62 KB

A p1 patch, I need to remember this.

Status: Needs review » Needs work

The last submitted patch, 4: 3103552-4.patch, failed testing. View results

  • marvil07 committed fe9812f on 8.x-1.x
    Issue #3103552 by jungle, marvil07: Fix deprecation notices related to...
  • marvil07 committed b2b75d1 on 9.x-1.x
    Issue #3103552 by jungle, marvil07: Fix deprecation notices related to...
marvil07’s picture

Assigned: marvil07 » Unassigned

Indeed the mentioned errors do not appear anymore, I added the last patch.

Not sure if we want to continue here; probably not, maybe it is better to use children tickets of #3103586: [Meta] Bring back all tests GREEN.

jungle’s picture

Status: Needs work » Fixed

Thanks, @marvil07 for committing. I would mark this as fixed.

Status: Fixed » Closed (fixed)

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