function MediaAccessControlHandlerTest::testMediaAccessControlHandlerDeprecation

Tests MediaAccessControlHandler deprecation.

@group legacy

File

core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php, line 561

Class

MediaAccessControlHandlerTest
Tests the media access control handler.

Namespace

Drupal\Tests\media\Kernel

Code

public function testMediaAccessControlHandlerDeprecation() {
    $this->expectDeprecation('Calling Drupal\\media\\MediaAccessControlHandler::__construct() without the $entity_type_manager argument is deprecated in drupal:9.3.0 and will be required in drupal:10.0.0. See https://www.drupal.org/node/3214171');
    $entity_type = $this->prophesize(EntityTypeInterface::class);
    $entity_type->id()
        ->willReturn('media');
    new MediaAccessControlHandler($entity_type->reveal());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.