class SystemDeprecationTest
@group system @group legacy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Kernel\SystemDeprecationTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of SystemDeprecationTest
File
-
core/
modules/ system/ tests/ src/ Kernel/ SystemDeprecationTest.php, line 11
Namespace
Drupal\Tests\system\KernelView source
class SystemDeprecationTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
'user',
];
/**
* @see system_sort_modules_by_info_name()
*/
public function testSystemSortModulesByInfoName() {
$module_info = \Drupal::service('extension.list.module')->getAllInstalledInfo();
$to_sort = [
'user' => (object) [
'info' => $module_info['user'],
],
'system' => (object) [
'info' => $module_info['system'],
],
];
$this->expectDeprecation('system_sort_modules_by_info_name() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\Core\\Extension\\ExtensionList::sortByName() instead. See https://www.drupal.org/node/3225999');
uasort($to_sort, 'system_sort_modules_by_info_name');
$this->assertSame([
'system',
'user',
], array_keys($to_sort));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.