only in patch2: unchanged: --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Tests/Block/SystemMenuBlockTest.php @@ -0,0 +1,66 @@ + 'System menu block test', + 'description' => 'Tests \Drupal\system\Plugin\Block\SystemMenuBlock.', + 'group' => 'System blocks', + ); + } + + public function testSystemMenuBlockConfigDependencies() { + // Add a new custom menu. + $menu_name = $this->randomName(16); + $label = $this->randomName(16); + + $menu = entity_create('menu', array( + 'id' => $menu_name, + 'label' => $label, + 'description' => 'Description text', + )); + $menu->save(); + + $block = entity_create('block', array( + 'plugin' => 'system_menu_block:'. $menu->id(), + 'region' => 'footer', + 'id' => 'machinename', + 'theme' => 'stark', + )); + + $dependencies = $block->calculateDependencies(); + $expected = array( + 'entity' => array( + 'system.menu.' . $menu->id() + ), + 'module' => array( + 'system' + ), + 'theme' => array( + 'stark' + ), + ); + $this->assertIdentical($expected, $dependencies); + } +} \ No newline at end of file