class MenuLegacyTest
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Menu/MenuLegacyTest.php \Drupal\KernelTests\Core\Menu\MenuLegacyTest
Deprecation test cases for the menu layer.
@group legacy
Hierarchy
- class \Drupal\KernelTests\Core\Menu\MenuLegacyTest
Expanded class hierarchy of MenuLegacyTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Menu/ MenuLegacyTest.php, line 12
Namespace
Drupal\KernelTests\Core\MenuView source
class MenuLegacyTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'menu_ui',
'system',
'user',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installConfig('system');
}
/**
* Tests deprecation of the menu_list_system_menus() function.
*/
public function testListSystemMenus() : void {
$this->expectDeprecation('menu_list_system_menus() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\system\\Entity\\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453');
$this->assertSame([
'tools' => 'Tools',
'admin' => 'Administration',
'account' => 'User account menu',
'main' => 'Main navigation',
'footer' => 'Footer menu',
], menu_list_system_menus());
}
/**
* Tests deprecation of the menu_ui_get_menus() function.
*/
public function testMenuUiGetMenus() : void {
$this->expectDeprecation('menu_ui_get_menus() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \\Drupal\\system\\Entity\\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453');
$this->assertSame([
'admin' => 'Administration',
'footer' => 'Footer',
'main' => 'Main navigation',
'tools' => 'Tools',
'account' => 'User account menu',
], menu_ui_get_menus());
}
}
Members
Title Sort descending | Deprecated | Modifiers | Object type | Summary |
---|---|---|---|---|
AssertLegacyTrait::assert | Deprecated | protected | function | |
AssertLegacyTrait::assertEqual | Deprecated | protected | function | |
AssertLegacyTrait::assertIdentical | Deprecated | protected | function | |
AssertLegacyTrait::assertIdenticalObject | Deprecated | protected | function | |
AssertLegacyTrait::assertNotEqual | Deprecated | protected | function | |
AssertLegacyTrait::assertNotIdentical | Deprecated | protected | function | |
AssertLegacyTrait::pass | Deprecated | protected | function | |
AssertLegacyTrait::verbose | Deprecated | protected | function | |
MenuLegacyTest::$modules | protected static | property | Modules to enable. | |
MenuLegacyTest::setUp | protected | function | ||
MenuLegacyTest::testListSystemMenus | public | function | Tests deprecation of the menu_list_system_menus() function. | |
MenuLegacyTest::testMenuUiGetMenus | public | function | Tests deprecation of the menu_ui_get_menus() function. | |
PhpUnitWarnings::$deprecationWarnings | private static | property | Deprecation warnings from PHPUnit to raise with @trigger_error(). | |
PhpUnitWarnings::addWarning | public | function | Converts PHPUnit deprecation warnings to E_USER_DEPRECATED. | |
StorageCopyTrait::replaceStorageContents | protected static | function | Copy the configuration from one storage to another and remove stale items. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.