diff -u b/core/modules/system/lib/Drupal/system/Tests/Graph/GraphUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Graph/GraphUnitTest.php --- b/core/modules/system/lib/Drupal/system/Tests/Graph/GraphUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Graph/GraphUnitTest.php @@ -35,16 +35,14 @@ // | | | // | | | // +---> 4 <-- 7 8 ---> 9 - $graph = $this->normalizeGraph(array( - 1 => array(2), - 2 => array(3, 4), - 3 => array(), - 4 => array(3), - 5 => array(6), - 7 => array(4, 5), - 8 => array(9), - 9 => array(), - )); + $graph[1]['edges'][2] = 1; + $graph[2]['edges'][3] = 1; + $graph[2]['edges'][4] = 1; + $graph[4]['edges'][3] = 1; + $graph[5]['edges'][6] = 1; + $graph[7]['edges'][4] = 1; + $graph[7]['edges'][5] = 1; + $graph[8]['edges'][9] = 1; $graph_object = new Graph($graph); $graph = $graph_object->searchAndSort(); @@ -126,15 +123,0 @@ - * Return a normalized version of a graph. - */ - function normalizeGraph($graph) { - $normalized_graph = array(); - foreach ($graph as $vertex => $edges) { - // Create vertex even if it hasn't any edges. - $normalized_graph[$vertex] = array(); - foreach ($edges as $edge) { - $normalized_graph[$vertex]['edges'][$edge] = TRUE; - } - } - return $normalized_graph; - } - - /**