$this->assertEqual(1,count(array_unique($result_components)),format_string('Expected one unique component for vertices @vertices, got @components',array('@vertices'=>$this->displayArray($component),'@components'=>$this->displayArray($result_components))));
$this->assertEquals(1,count(array_unique($result_components)),sprintf('Expected one unique component for vertices %s, got %s',$this->displayArray($component),$this->displayArray($result_components)));
}
$this->assertEqual(array(),$unassigned_vertices,format_string('Vertices not assigned to a component: @vertices',array('@vertices'=>$this->displayArray($unassigned_vertices,TRUE))));
$this->assertEquals(array(),$unassigned_vertices,sprintf('Vertices not assigned to a component: %s',$this->displayArray($unassigned_vertices,TRUE)));
}
/**
* Verify expected order in a graph.
*
* @param $graph
* A graph array processed by Drupal\Component\Graph\Graph::searchAndSort().
* A graph array processed by \Drupal\Component\Graph\Graph::searchAndSort()
* @param $expected_orders
* An array containing lists of vertices in their expected order.
$this->assertTrue($graph[$previous_vertex]['weight']<$graph[$vertex]['weight'],format_string('Weights of @previous-vertex and @vertex are correct relative to each other',array('@previous-vertex'=>$previous_vertex,'@vertex'=>$vertex)));
$this->assertTrue($graph[$previous_vertex]['weight']<$graph[$vertex]['weight'],sprintf('Weights of %s and %s are correct relative to each other',$previous_vertex,$vertex));
}
}
}
...
...
@@ -187,7 +194,7 @@ function assertWeights($graph, $expected_orders) {
* @param $keys
* (optional) Whether to output the keys of $paths instead of the values.