- Issue created by @alexpott
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Note this does not happen for core tests only contrib because they are using the --xml flag and core is not. If you make a test fail and use the following flags on a test you will see the error
--verbose --xml tmp --class '\\Drupal\\Tests\\Core\\Access\\AccessManagerTest'
For example:
$ php ./core/scripts/run-tests.sh --php /opt/homebrew/bin/php --sqlite /tmp/coretest.sqlite --dburl mysql://USER:PASSWORD@localhost/drupal8alt --color --non-html --url http://drupal8alt.test/ --verbose --xml tmp --class '\\Drupal\\Tests\\Core\\Access\\AccessManagerTest' Drupal test run Using PHP Binary: /opt/homebrew/bin/php --------------- Tests to be run: - \Drupal\Tests\Core\Access\AccessManagerTest Test run started: Tuesday, January 14, 2025 - 09:54 Test summary ------------ \Drupal\Tests\Core\Access\AccessManagerTest 0 passes 1s 1 fails Test run duration: 0 sec Detailed test results --------------------- ---- \Drupal\Tests\Core\Access\AccessManagerTest ---- Status Group Filename Line Function -------------------------------------------------------------------------------- Fail Other phpunit-7.xml 0 \Drupal\Tests\Core\Access\AccessMan PHPUnit Test failed to complete; Error: PHPUnit 10.5.38 by Sebastian Bergmann and contributors. Runtime: PHP 8.3.14 Configuration: /Volumes/dev/sites/drupal8alt.dev/core/phpunit.xml.dist F................. 18 / 18 (100%) Time: 00:00.034, Memory: 16.00 MB Access Manager (Drupal\Tests\Core\Access\AccessManager) ✘ Set checks ┐ ├ Failed asserting that true is false. │ │ /Volumes/dev/sites/drupal8alt.dev/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php:136 ┴ ✔ Set checks with dynamic access checker ✔ Check ✔ Check with null account ✔ Check conjunctions with data set 0 ✔ Check conjunctions with data set 1 ✔ Check conjunctions with data set 2 ✔ Check conjunctions with data set 3 ✔ Check conjunctions with data set 4 ✔ Check conjunctions with data set 5 ✔ Check named route ✔ Check named route with upcasted values ✔ Check named route with default value ✔ Check named route with non existing route ✔ Check exception with data set 0 ✔ Check exception with data set 1 ✔ Check exception with data set 2 ✔ Check exception with data set 3 FAILURES! Tests: 18, Assertions: 62, Failures: 1. PHP Warning: DOMDocument::saveXML(): xmlEscapeEntities : char out of range in /Volumes/dev/sites/drupal8alt.dev/core/scripts/run-tests.sh on line 1316 Warning: DOMDocument::saveXML(): xmlEscapeEntities : char out of range in /Volumes/dev/sites/drupal8alt.dev/core/scripts/run-tests.sh on line 1316
- 🇮🇳India abhishek@kumar
Locate the relevant line in run-tests.sh (near DOMDocument::saveXML) and update it to include the encoding explicitly:
$dom = new DOMDocument('1.0', 'UTF-8'); $dom->formatOutput = true;
This ensures that Unicode characters, such as emojis, are processed correctly by DOMDocument.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Created https://git.drupalcode.org/project/drupal/-/merge_requests/10912 to handle backport to 11.1.x and further...
- 🇬🇧United Kingdom catch
Committed/pushed to 11.1.x and cherry-picked to 10.5.x and 10.4.x, thanks!