Skip to content
Snippets Groups Projects
Verified Commit a9accd54 authored by catch's avatar catch Committed by Dave Long
Browse files

Issue #3154084 by amateescu, mheip, smustgrave: Warning when building an empty workspace tree

(cherry picked from commit 2a17c29f)
parent 0a260f5a
No related branches found
No related tags found
7 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!3603#ISSUE 3346218 Add a different message on edit comment,!3555Issue #2473873: Views entity operations lack cacheability support, resulting in incorrect dropbuttons,!3494Issue #3327018 by Spokje, longwave, xjm, mondrake: Update PHPStan to 1.9.3 and...
......@@ -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']),
......
......@@ -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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment