function LegacyFileModuleTest::testFileIconMapDeprecation

Same name in other branches
  1. 10 core/modules/file/tests/src/Kernel/LegacyFileModuleTest.php \Drupal\Tests\file\Kernel\LegacyFileModuleTest::testFileIconMapDeprecation()

@covers ::file_icon_map

File

core/modules/file/tests/src/Kernel/LegacyFileModuleTest.php, line 33

Class

LegacyFileModuleTest
Tests file module deprecations.

Namespace

Drupal\Tests\file\Kernel

Code

public function testFileIconMapDeprecation() : void {
    $this->expectDeprecation('file_icon_map() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \\Drupal\\file\\IconMimeTypes::getGenericMimeType() instead. See https://www.drupal.org/node/3411269');
    $mimeType = \file_icon_map('application/msword');
    $this->assertEquals('x-office-document', $mimeType);
}

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