diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-04-11 17:58:18 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-04-11 17:58:18 +0000 |
commit | c7095deb64f6a63c1663bf10dc377eff972c8887 (patch) | |
tree | 552afd8cf834a066d8fa04bd03d7531420f0b2ee /modules/simpletest | |
parent | 1de1293df0077fb2e17248e826607ab0004e9851 (diff) | |
download | brdo-c7095deb64f6a63c1663bf10dc377eff972c8887.tar.gz brdo-c7095deb64f6a63c1663bf10dc377eff972c8887.tar.bz2 |
#423664 by Berdir: Fix dependency checking of non-existing modules. (with corrected tests)
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/graph.test | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/simpletest/tests/graph.test b/modules/simpletest/tests/graph.test index cd88c2ee2..a6dac87ef 100644 --- a/modules/simpletest/tests/graph.test +++ b/modules/simpletest/tests/graph.test @@ -39,6 +39,7 @@ class GraphUnitTest extends DrupalWebTestCase { 5 => array(6), 7 => array(4, 5), 8 => array(9), + 9 => array(), )); drupal_depth_first_search($graph); @@ -48,7 +49,6 @@ class GraphUnitTest extends DrupalWebTestCase { 3 => array(), 4 => array(3), 5 => array(6), - 6 => array(), 7 => array(4, 3, 5, 6), 8 => array(9), 9 => array(), @@ -61,15 +61,17 @@ class GraphUnitTest extends DrupalWebTestCase { 3 => array(2, 1, 4, 7), 4 => array(2, 1, 7), 5 => array(7), - 6 => array(5, 7), 7 => array(), 8 => array(), 9 => array(8), ); $this->assertReversePaths($graph, $expected_reverse_paths); + // Assert that DFS didn't created "missing" vertexes automatically. + $this->assertFALSE(isset($graph[6]), t('Vertex 6 has not been created')); + $expected_components = array( - array(1, 2, 3, 4, 5, 6, 7), + array(1, 2, 3, 4, 5, 7), array(8, 9), ); $this->assertComponents($graph, $expected_components); @@ -78,7 +80,7 @@ class GraphUnitTest extends DrupalWebTestCase { array(1, 2, 3), array(2, 4, 3), array(7, 4, 3), - array(7, 5, 6), + array(7, 5), array(8, 9), ); $this->assertWeights($graph, $expected_weights); @@ -90,6 +92,8 @@ class GraphUnitTest extends DrupalWebTestCase { 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; } |