Chris@0: config('system.site')->set('page.front', '/test-page')->save(); Chris@0: Chris@0: // Create Full HTML text format. Chris@0: $full_html_format = FilterFormat::create([ Chris@0: 'format' => 'full_html', Chris@0: 'name' => 'Full HTML', Chris@0: ]); Chris@0: $full_html_format->save(); Chris@0: Chris@0: // Create and log in an administrative user having access to the Full HTML Chris@0: // text format. Chris@0: $this->adminUser = $this->drupalCreateUser([ Chris@0: 'administer blocks', Chris@0: $full_html_format->getPermissionName(), Chris@0: 'access administration pages', Chris@0: ]); Chris@0: $this->drupalLogin($this->adminUser); Chris@0: Chris@0: // Define the existing regions. Chris@0: $this->regions = [ Chris@0: 'header', Chris@0: 'sidebar_first', Chris@0: 'content', Chris@0: 'sidebar_second', Chris@0: 'footer', Chris@0: ]; Chris@0: $block_storage = $this->container->get('entity_type.manager')->getStorage('block'); Chris@0: $blocks = $block_storage->loadByProperties(['theme' => $this->config('system.theme')->get('default')]); Chris@0: foreach ($blocks as $block) { Chris@0: $block->delete(); Chris@0: } Chris@0: } Chris@0: Chris@0: }