Fix test failures on GitLab CI

Created on 26 March 2024, 3 months ago
Updated 28 April 2024, 2 months ago

Problem/Motivation

The ConfigIgnoreTest::testSettingsForm() test is failing on GitLab CI (both on MRs and on the main 8.x-3.x-dev branch build).

The failure seems to be related to this old Drupal core change record:
t() returns a TranslatableMarkup object instead of a string β†’

PHPUnit 9.6.18 by Sebastian Bergmann and contributors
...E.............................................................. 65 / 71 ( 91%)
......                                                            71 / 71 (100%)
Time: 01:11.062, Memory: 6.00 MB
There was 1 error:
1) Drupal\Tests\config_ignore\Functional\ConfigIgnoreTest::testSettingsForm
TypeError: Behat\Mink\Element\TraversableElement::findButton(): Argument #1 ($locator) must be of type string, Drupal\Core\StringTranslation\TranslatableMarkup given, called in /builds/issue/config_ignore-3432315/web/core/tests/Drupal/Tests/WebAssert.php on line 143
/builds/issue/config_ignore-3432315/vendor/behat/mink/src/Element/TraversableElement.php:97
/builds/issue/config_ignore-3432315/web/core/tests/Drupal/Tests/WebAssert.php:143
/builds/issue/config_ignore-3432315/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
/builds/issue/config_ignore-3432315/tests/src/Functional/ConfigIgnoreTest.php:37
/builds/issue/config_ignore-3432315/vendor/phpunit/phpunit/src/Framework/TestResult.php:729
ERRORS!
Tests: 71, Assertions: 2309, Errors: 1.

Steps to reproduce

Create a MR on an issue for this module targeting the 8.x-3.x branch. The PHPunit tests pipeline on GitLab CI will have the failure above.

Proposed resolution

Update the submitForm() call in ConfigIgnoreTest::testSettingsForm() to either pass a raw string as the second argument (like Drupal core's tests do) or cast the result of $this->t() to a string.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States joegraduate Arizona, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024