function LegacyFileModuleTest::testFileIconClassDeprecation

Same name and namespace in other branches
  1. 11.x core/modules/file/tests/src/Kernel/LegacyFileModuleTest.php \Drupal\Tests\file\Kernel\LegacyFileModuleTest::testFileIconClassDeprecation()

@covers ::file_icon_class

File

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

Class

LegacyFileModuleTest
Tests file module deprecations.

Namespace

Drupal\Tests\file\Kernel

Code

public function testFileIconClassDeprecation() : void {
    $this->expectDeprecation('file_icon_class() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \\Drupal\\file\\IconMimeTypes::getIconClass() instead. See https://www.drupal.org/node/3411269');
    $iconClass = \file_icon_class('image/jpeg');
    $this->assertEquals('image', $iconClass);
}

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