
| Current Path : /var/www/html1/web/core/modules/system/tests/src/Functional/Update/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html1/web/core/modules/system/tests/src/Functional/Update/MenuBlockPostUpdateTest.php |
<?php
namespace Drupal\Tests\system\Functional\Update;
use Drupal\block\Entity\Block;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
/**
* Tests updating menu blocks configuration.
*
* @group Update
* @group legacy
*/
class MenuBlockPostUpdateTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
// Use a more recent fixture for performance, do not run all pre-8.4
// updates when testing this feature.
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
];
}
/**
* Tests updating blocks with default 'expand_all_items' value.
*
* @see system_post_update_add_expand_all_items_key_in_system_menu_block()
*/
public function testPostUpdateMenuBlockFields() {
$this->assertArrayNotHasKey('expand_all_items', Block::load('bartik_account_menu')->get('settings'));
$this->runUpdates();
$settings = Block::load('bartik_account_menu')->get('settings');
$this->assertArrayHasKey('expand_all_items', $settings);
$this->assertFalse($settings['expand_all_items']);
}
}