diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index b03a2c8..e90e407 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -148,16 +148,25 @@ function testBlock() { * Tests that the block form has a theme selector when not passed via the URL. */ public function testBlockThemeSelector() { - // Select the 'Powered by Drupal' block to be configured and moved. - $block = array(); - $block['machine_name'] = strtolower($this->randomName(8)); - $block['theme'] = $this->container->get('config.factory')->get('system.theme')->get('default'); - $block['region'] = 'header'; - - $this->drupalPost('admin/structure/block/add/system_powered_by_block', $block, t('Save block')); - $this->assertText(t('The block configuration has been saved.')); - $elements = $this->xpath('//div[@id = :id]', array(':id' => drupal_html_id('block-' . $block['machine_name']))); - $this->assertTrue(!empty($elements), 'The block was found.'); + // Enable all themes. + theme_enable(array('bartik', 'seven')); + $theme_settings = $this->container->get('config.factory')->get('system.theme'); + foreach (array('bartik', 'stark', 'seven') as $theme) { + // Select the 'Powered by Drupal' block to be placed. + $block = array(); + $block['machine_name'] = strtolower($this->randomName(8)); + $block['theme'] = $theme; + $block['region'] = 'content'; + $this->drupalPost('admin/structure/block/add/system_powered_by_block', $block, t('Save block')); + $this->assertText(t('The block configuration has been saved.')); + $this->assertUrl('admin/structure/block/list/' . $theme . '?block-placement=' . drupal_html_class($theme . ':' . $block['machine_name'])); + + // Set the default theme and ensure the block is placed. + $theme_settings->set('default', $theme)->save(); + $this->drupalGet(''); + $elements = $this->xpath('//div[@id = :id]', array(':id' => drupal_html_id('block-' . $block['machine_name']))); + $this->assertTrue(!empty($elements), 'The block was found.'); + } } /** diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 1ebccca..5e32613 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -2377,7 +2377,11 @@ protected function assertUrl($path, array $options = array(), $message = '', $gr )); } $options['absolute'] = TRUE; - return $this->assertEqual($this->getUrl(), $this->container->get('url_generator')->generateFromPath($path, $options), $message, $group); + // Paths in query strings can be encoded or decoded with no functional + // difference, decode them for comparison purposes. + $actual_url = urldecode($this->getUrl()); + $expected_url = urldecode($this->container->get('url_generator')->generateFromPath($path, $options)); + return $this->assertEqual($actual_url, $expected_url, $message, $group); } /**