Problem/Motivation

Tests pass with PHP 8.0, but with PHP 8.1, I'm seeing an unexpected failure:

Drupal\Tests\twig_ui\FunctionalJavascript\TemplateFormTest

fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-1.xml:
PHPUnit Test failed to complete; Error: PHPUnit 9.5.20 �[44m#StandWith�[0m�[43mUkraine�[0m

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing Drupal\Tests\twig_ui\FunctionalJavascript\TemplateFormTest
F.                                                                  2 / 2 (100%)

Time: 00:14.126, Memory: 4.00 MB

There was 1 failure:

1) Drupal\Tests\twig_ui\FunctionalJavascript\TemplateFormTest::testTemplateFormTemplateLoad
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
  * Available variables:\n
  * - plugin_id: The ID of the block implementation.\n
  * - label: The configured label of the block if visible.\n
- * - configuration: A list of the block's configuration values.\n
+ * - configuration: A list of the block's configuration values.\n
  *   - label: The configured label for the block.\n
  *   - label_display: The display settings for the label.\n
  *   - provider: The module or other provider that provided this block plugin.\n

/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php:96
/var/www/html/modules/contrib/twig_ui/tests/src/FunctionalJavascript/TemplateFormTest.php:143
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

FAILURES!
Tests: 2, Assertions: 29, Failures: 1.

Steps to reproduce

Run tests with PHP 8.1.

Proposed resolution

Debug and fix failing test.

Remaining tasks

Submit patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

Chris Burge created an issue. See original summary.

chris burge’s picture

Status: Active » Needs review
StatusFileSize
new849 bytes

Patch attached.

Status: Needs review » Needs work

The last submitted patch, 2: twig_ui-php81_test_failure-3278105-2.patch, failed testing. View results

chris burge’s picture

Status: Needs work » Needs review
StatusFileSize
new936 bytes
chris burge’s picture

StatusFileSize
new906 bytes
chris burge’s picture

See htmlentities: Changelog re $flags. In PHP 8.1.0, flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401.

  • Chris Burge committed a94cd35 on 1.0.x
    Issue #3278105 by Chris Burge: Branch Test Failure on PHP 8.1
    
chris burge’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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