Problem/Motivation

Some error messages and types have changed in PHP 8.

Steps to reproduce

See #3156595: Make Drupal 9 installable on PHP8

Proposed resolution

Depending PHP version adjust test expectations.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

CommentFileSizeAuthor
#2 3178998-2.patch6.7 KBalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new6.7 KB

This patch has been carved off #3156595: Make Drupal 9 installable on PHP8

alexpott’s picture

alexpott’s picture

Issue tags: +PHP 8.0
andypost’s picture

looks it need manual testing to confirm, this tests pass on php 8, otoh it's part of passed https://www.drupal.org/pift-ci-job/1863463

So just need to make sure all changes moved

catch’s picture

+++ b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
@@ -111,7 +111,9 @@ public function testUncaughtException() {
-      '@message' => 'Argument 1 passed to Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}() must be of the type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 65',
+      '@message' => PHP_VERSION_ID >= 80000 ?
+        'Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}(): Argument #1 ($test) must be of type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 65' :

Do we want a @todo remove when Drupal requires PHP 8/drops support for PHP 7.4 for each of these?

alexpott’s picture

@catch I don't think so. The issue to remove PHP 7 stuff will be quite big and involve far more.

andypost’s picture

andypost’s picture

Status: Needs review » Reviewed & tested by the community

All 4 tests running fine on php8 locally using patch #3156595-112: Make Drupal 9 installable on PHP8

I compared patch #2 with cumulative one from issue above and it contains exactly only fixes for the scope (remains has separate issues)

it looks backportable to 8.9

alexpott’s picture

+++ b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
@@ -111,7 +111,9 @@ public function testUncaughtException() {
+      '@message' => PHP_VERSION_ID >= 80000 ?

To clarify why I think an @todo is not required here... Once you have a comparison as obvious as this I think an @todo is not necessary because this is clearly something that relies on PHP version. Any issue that is trying to remove code that depends on unsupported PHP versions needs to grep for this type of thing.

  • catch committed 9066196 on 9.2.x
    Issue #3178998 by alexpott, andypost: Update error types and messages...

  • catch committed 90ac0c5 on 9.1.x
    Issue #3178998 by alexpott, andypost: Update error types and messages...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Yeah OK on the comment, PHP_VERSION_ID is indeed very greppable by itself and andypost thanks for filing #3179048: [meta] Remove dead code/unneeded compatibility layers now that PHP 8.1 is required

Committed 9066196 and pushed to 9.2.x. Thanks! Cherry-picked to 9.1.x

Status: Fixed » Closed (fixed)

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