--- a/Tests/Services/SearchServiceTest.php Tue Feb 21 15:15:22 2012 +0100
+++ b/Tests/Services/SearchServiceTest.php Thu Feb 23 23:02:07 2012 +0100
@@ -97,12 +97,20 @@
$search_service = $this->get("wiki_tag.search");
$result = $search_service->completion("tag");
+ $completion_result = array(
+ 'Tag1' => 2,
+ 'Tag2' => 4,
+ 'Tag3' => 5,
+ 'Tag4' => 6
+ );
$this->assertNotNull($result, "completion should not be null");
$this->assertEquals(4, count($result));
foreach ($result as $tagname) {
- $this->assertEquals(0,strpos($tagname,"tag"));
+ $this->assertEquals(0,strpos($tagname['label'],"Tag"));
+ $this->assertArrayHasKey($tagname['label'], $completion_result);
+ $this->assertEquals($completion_result[$tagname['label']], $tagname['nb_docs']);
}
}