X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fblock%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FBlockRemoveDisabledRegionUpdateTest.php;fp=web%2Fcore%2Fmodules%2Fblock%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FBlockRemoveDisabledRegionUpdateTest.php;h=4409c2868e508d9637f992b93398081e9d7c04bb;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php b/web/core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php new file mode 100644 index 000000000..4409c2868 --- /dev/null +++ b/web/core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php @@ -0,0 +1,57 @@ +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', + ]; + } + + /** + * Tests that block context mapping is updated properly. + */ + public function testUpdateHookN() { + $this->runUpdates(); + + // Disable maintenance mode. + \Drupal::state()->set('system.maintenance_mode', FALSE); + + // We finished updating so we can login the user now. + $this->drupalLogin($this->rootUser); + + // Verify that a disabled block is in the default region. + $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)); + + // Verify that an enabled block is now disabled and in the default region. + $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)); + + } + +}