function ExtensionMimeTypeGuesserDeprecationTest::testConstructorDeprecation

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/File/ExtensionMimeTypeGuesserDeprecationTest.php \Drupal\KernelTests\Core\File\ExtensionMimeTypeGuesserDeprecationTest::testConstructorDeprecation()

Tests that deprecations are raised for missing constructor arguments.

@legacy-covers \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::__construct

Attributes

#[IgnoreDeprecations]

File

core/tests/Drupal/KernelTests/Core/File/ExtensionMimeTypeGuesserDeprecationTest.php, line 35

Class

ExtensionMimeTypeGuesserDeprecationTest
Tests that deprecation messages are raised for deprecations.

Namespace

Drupal\KernelTests\Core\File

Code

public function testConstructorDeprecation() : void {
  $this->expectDeprecation('Calling Drupal\\Core\\File\\MimeType\\ExtensionMimeTypeGuesser::__construct() with the $map argument as an instance of \\Drupal\\Core\\Extension\\ModuleHandlerInterface is deprecated in drupal:11.2.0 and an instance of \\Drupal\\Core\\File\\MimeType\\MimeTypeMapInterface is required in drupal:12.0.0. See https://www.drupal.org/node/3494040');
  new ExtensionMimeTypeGuesser(\Drupal::service('module_handler'));
}

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