diff --git a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6Block.php b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6Block.php index cb3c9d9..fa67855 100644 --- a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6Block.php +++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6Block.php @@ -170,7 +170,7 @@ public function load() { 'pages' => '', 'title' => '', 'cache' => '-1' - )) + )) ->values(array( 'bid' => '2', 'module' => 'user', @@ -321,6 +321,36 @@ public function load() { 'title' => 'Another Static Block', 'cache' => '-1' )) + ->values(array( + 'bid' => '12', + 'module' => 'block', + 'delta' => '1', + 'theme' => 'test_theme', + 'status' => '1', + 'weight' => '-7', + 'region' => 'right', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) + ->values(array( + 'bid' => '13', + 'module' => 'block', + 'delta' => '2', + 'theme' => 'test_theme', + 'status' => '1', + 'weight' => '-2', + 'region' => 'left', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1' + )) ->execute(); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php index 4590b26..ce4f98d 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php @@ -59,14 +59,20 @@ public function setUp() { 'd6_custom_block' => array( array(array(10), array(1)), array(array(11), array(2)), + array(array(12), array(1)), + array(array(13), array(2)), ) )); + // Set Bartik and Seven as the default public and admin theme. $config = \Drupal::config('system.theme'); $config->set('default', 'bartik'); $config->set('admin', 'seven'); $config->save(); + // Enable one of D8's test themes. + \Drupal::service('theme_handler')->enable(array('test_theme')); + /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_block'); $dumps = array( @@ -83,7 +89,7 @@ public function setUp() { public function testBlockMigration() { /** @var $blocks \Drupal\block\BlockInterface[] */ $blocks = entity_load_multiple('block'); - $this->assertEqual(count($blocks), 6); + $this->assertEqual(count($blocks), 8); // User blocks $test_block_user = $blocks['user']; @@ -142,5 +148,23 @@ public function testBlockMigration() { $this->assertEqual(FALSE, $visibility['request_path']['negate']); $this->assertEqual('node', $visibility['request_path']['pages']); $this->assertEqual(-4, $test_block_block_1->weight); + + $test_block_block_2 = $blocks['block_2']; + $this->assertNotNull($test_block_block_2); + $this->assertEqual('right', $test_block_block_2->get('region')); + $this->assertEqual('test_theme', $test_block_block_2->get('theme')); + $visibility = $test_block_block_2->getVisibility(); + $this->assertEqual(TRUE, $visibility['request_path']['negate']); + $this->assertEqual('', $visibility['request_path']['pages']); + $this->assertEqual(-7, $test_block_block_2->weight); + + $test_block_block_3 = $blocks['block_3']; + $this->assertNotNull($test_block_block_3); + $this->assertEqual('left', $test_block_block_3->get('region')); + $this->assertEqual('test_theme', $test_block_block_3->get('theme')); + $visibility = $test_block_block_3->getVisibility(); + $this->assertEqual(TRUE, $visibility['request_path']['negate']); + $this->assertEqual('', $visibility['request_path']['pages']); + $this->assertEqual(-2, $test_block_block_3->weight); } } diff --git a/core/modules/system/tests/themes/test_theme/test_theme.info.yml b/core/modules/system/tests/themes/test_theme/test_theme.info.yml index d845875..e35a15d 100644 --- a/core/modules/system/tests/themes/test_theme/test_theme.info.yml +++ b/core/modules/system/tests/themes/test_theme/test_theme.info.yml @@ -17,3 +17,7 @@ stylesheets-remove: - system.module.css settings: theme_test_setting: 'default value' +regions: + content: Content + left: Left + right: Right