class NavigationUpdateTest
Same name and namespace in other branches
- 11.x core/modules/navigation/tests/src/Functional/Update/NavigationUpdateTest.php \Drupal\Tests\navigation\Functional\Update\NavigationUpdateTest
Tests moving search from node to search_node.
Attributes
#[Group('navigation')]
#[RunTestsInSeparateProcesses]
#[IgnoreDeprecations]
Hierarchy
- class \Drupal\Tests\navigation\Functional\Update\NavigationUpdateTest extends \Drupal\FunctionalTests\Update\UpdatePathTestBase
Expanded class hierarchy of NavigationUpdateTest
File
-
core/
modules/ navigation/ tests/ src/ Functional/ Update/ NavigationUpdateTest.php, line 15
Namespace
Drupal\Tests\navigation\Functional\UpdateView source
class NavigationUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() : void {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-11.3.0.bare.standard.php.gz',
__DIR__ . '/../../../fixtures/navigation_post_update.php',
];
}
/**
* Tests the removal of the navigation_shortcuts block.
*/
public function testShortcutNavigationBlockUpdate() : void {
$this->assertTrue(\Drupal::moduleHandler()->moduleExists('navigation'));
$this->assertFalse(\Drupal::moduleHandler()->moduleExists('shortcut'));
$config = \Drupal::config('navigation.block_layout');
$sections = $config->get('sections');
// Confirm the navigation shortcut block exists.
// UUID of the navigation_shortcuts block.
$uuid = '2622e40b-8786-4b8c-8883-19e49da53023';
$this->assertArrayHasKey($uuid, $sections[0]['components']);
$this->runUpdates();
// Confirm the navigation shortcut block has been removed.
$config = \Drupal::config('navigation.block_layout');
$sections = $config->get('sections');
$this->assertArrayNotHasKey($uuid, $sections[0]['components']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.