Change record status: 
Project: 
Introduced in branch: 
9.1.x
Introduced in version: 
9.1.0
Description: 

Drupal 9.1 testing framework uses symfony/phpunit-bridge 5.1.

In that version, the use of @expectedDeprecation annotations in tests is deprecated itself, and tests should use the "ExpectDeprecationTrait::expectDeprecation()" method instead.

BEFORE

   /**
    * @group legacy
    * @expectedDeprecation The event_dispatcher service should be passed to LayoutBuilder::__construct() instead of the layout_builder.tempstore_repository service since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3152690
    */
   public function testConstructorTempStoreDeprecation() {
     $layout_temp_storage = $this->prophesize(LayoutTempstoreRepositoryInterface::class);
     $element = new LayoutBuilder(
       [],

AFTER

   /**
    * @group legacy
    */
   public function testConstructorTempStoreDeprecation() {
     $this->expectDeprecation('The event_dispatcher service should be passed to LayoutBuilder::__construct() instead of the layout_builder.tempstore_repository service since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3152690');
     $layout_temp_storage = $this->prophesize(LayoutTempstoreRepositoryInterface::class);
     $element = new LayoutBuilder(
       [],
Impacts: 
Module developers

Comments

andrewmacpherson’s picture

Using the @expectedDeprecation annotations in tests is deprecated

Oh, the irony!

mondrake’s picture

Nomen omen