Loading core/modules/workspaces/src/WorkspaceRepository.php +1 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ public function loadTree() { } $graph = (new Graph($graph))->searchAndSort(); $this->tree = []; foreach (array_keys($tree) as $workspace_id) { $this->tree[$workspace_id] = [ 'depth' => count($graph[$workspace_id]['paths']), Loading core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php +8 −0 Original line number Diff line number Diff line Loading @@ -323,4 +323,12 @@ public function testDeletingWorkspaceWithChildren() { $this->assertNull(Workspace::load('stage')); } /** * Tests loading the workspace tree when there are no workspaces available. */ public function testEmptyWorkspaceTree() { $tree = \Drupal::service('workspaces.repository')->loadTree(); $this->assertSame([], $tree); } } Loading
core/modules/workspaces/src/WorkspaceRepository.php +1 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ public function loadTree() { } $graph = (new Graph($graph))->searchAndSort(); $this->tree = []; foreach (array_keys($tree) as $workspace_id) { $this->tree[$workspace_id] = [ 'depth' => count($graph[$workspace_id]['paths']), Loading
core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php +8 −0 Original line number Diff line number Diff line Loading @@ -323,4 +323,12 @@ public function testDeletingWorkspaceWithChildren() { $this->assertNull(Workspace::load('stage')); } /** * Tests loading the workspace tree when there are no workspaces available. */ public function testEmptyWorkspaceTree() { $tree = \Drupal::service('workspaces.repository')->loadTree(); $this->assertSame([], $tree); } }