Problem/Motivation

\Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest cuases PHP 8.5 dprecations due to incomplete mocking on EntityType

Steps to reproduce

Run \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest on PHP 8.5

Proposed resolution

Fix the mock.

Remaining tasks

User interface changes

None

Introduced terminology

N/a

API changes

None

Data model changes

None

Release notes snippet

N/a

Issue fork drupal-3555886

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

alexpott’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Upgraded my ddev with 8.5
Without the MR
3 PHP deprecations:

After applying the MR I still get 2

example

1) /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityBase.php:713
Using null as an array offset is deprecated, use an empty string instead

Triggered by:

* Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest::testAccess (2 times)
  /var/www/html/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php:541
alexpott’s picture

Status: Needs work » Needs review
andypost’s picture

Status: Needs review » Reviewed & tested by the community

Agree this fix is cleaner

  • catch committed b859a4c0 on 11.3.x
    Issue #3555886 by alexpott, smustgrave: \Drupal\Tests\Core\Entity\...

  • catch committed 22f40445 on 11.x
    Issue #3555886 by alexpott, smustgrave: \Drupal\Tests\Core\Entity\...
catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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