$this->assertEqual(1,count(array_unique($result_components)),t('Expected one unique component for vertices @vertices, got @components',array('@vertices'=>$this->displayArray($component),'@components'=>$this->displayArray($result_components))));
}
$this->assertEqual(array(),$unassigned_vertices,t('Vertices not assigned to a component: @vertices',array('@vertices'=>$this->displayArray($unassigned_vertices,TRUE))));
}
/**
* Verify expected order in a graph.
*
* @param $graph
* A graph array processed by drupal_depth_first_search().
* @param $expected_orders
* An array containing lists of vertices in their expected order.
*/
functionassertWeights($graph,$expected_orders){
foreach($expected_ordersas$order){
$previous_vertex=array_shift($order);
foreach($orderas$vertex){
$this->assertTrue($graph[$previous_vertex]['weight']<$graph[$vertex]['weight'],t('Weights of @previous-vertex and @vertex are correct relative to each other',array('@previous-vertex'=>$previous_vertex,'@vertex'=>$vertex)));
}
}
}
/**
* Helper function to output vertices as comma-separated list.
*
* @param $paths
* An array containing a list of vertices.
* @param $keys
* (optional) Whether to output the keys of $paths instead of the values.