MenuBlockPostUpdateTest.php in Drupal 8
File
core/modules/system/tests/src/Functional/Update/MenuBlockPostUpdateTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\Update;
use Drupal\block\Entity\Block;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class MenuBlockPostUpdateTest extends UpdatePathTestBase {
protected $defaultTheme = 'stark';
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
];
}
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']);
}
}