BlockRemoveDisabledRegionUpdateTest.php in Drupal 8
File
core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php
View source
<?php
namespace Drupal\Tests\block\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class BlockRemoveDisabledRegionUpdateTest extends UpdatePathTestBase {
protected static $modules = [
'block_test',
'language',
];
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.update-test-block-disabled-2513534.php',
];
}
public function testUpdateHookN() {
$this
->runUpdates();
\Drupal::state()
->set('system.maintenance_mode', FALSE);
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('admin/structure/block');
$element = $this
->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]", [
':block' => 'edit-blocks-pagetitle-1',
':status' => 'block-disabled',
':region' => 'header',
]);
$this
->assertTrue(!empty($element));
$this
->drupalGet('admin/structure/block');
$element = $this
->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]", [
':block' => 'edit-blocks-pagetitle-2',
':status' => 'block-disabled',
':region' => 'header',
]);
$this
->assertTrue(!empty($element));
}
}