only in patch2: unchanged: --- a/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php +++ b/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php @@ -76,7 +76,7 @@ protected function doTestTable() { // that selecting from the storage creates the table. $tree_storage = new MenuTreeStorage($this->container->get('database'), $this->container->get('cache.menu'), 'test_menu_tree'); $this->assertFalse($this->connection->schema()->tableExists('test_menu_tree'), 'Test table is not yet created'); - $tree_storage->countMenuLinks(); + $tree_storage->save($this->getLinkArray($this->randomMachineName())); $this->assertTrue($this->connection->schema()->tableExists('test_menu_tree'), 'Test table was created'); } @@ -329,17 +329,7 @@ public function testLoadByProperties() { * Adds a link with the given ID and supply defaults. */ protected function addMenuLink($id, $parent = '', $route_name = 'test', $route_parameters = array(), $menu_name = 'tools', $extra = array()) { - $link = array( - 'id' => $id, - 'menu_name' => $menu_name, - 'route_name' => $route_name, - 'route_parameters' => $route_parameters, - 'title_arguments' => array(), - 'title' => 'test', - 'parent' => $parent, - 'options' => array(), - 'metadata' => array(), - ) + $extra; + $link = $this->getLinkArray($id, $parent, $route_name, $route_parameters, $menu_name) + $extra; $this->treeStorage->save($link); } @@ -412,4 +402,26 @@ protected function assertMenuLink($id, array $expected_properties, array $parent $this->assertEqual(array_intersect($children, $found_children), $children, 'Child IDs match'); } + /** + * @param $id + * @param $parent + * @param $route_name + * @param $route_parameters + * @param $menu_name + * @return array + */ + protected function getLinkArray($id, $parent = '', $route_name = 'test', $route_parameters = array(), $menu_name = 'tools') { + return array( + 'id' => $id, + 'menu_name' => $menu_name, + 'route_name' => $route_name, + 'route_parameters' => $route_parameters, + 'title_arguments' => array(), + 'title' => 'test', + 'parent' => $parent, + 'options' => array(), + 'metadata' => array(), + ); + } + }