From 3fed52e12907b55aa9542b8d0da42c3992f8384f Mon Sep 17 00:00:00 2001 From: Guillaume Turri Date: Mon, 21 Jan 2013 21:13:15 +0100 Subject: Added test for search_allpages Currently both the 2nd and the third assertions fail (the first one is just for upcoming non-regression) --- _test/tests/inc/search/search.test.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to '_test/tests/inc') diff --git a/_test/tests/inc/search/search.test.php b/_test/tests/inc/search/search.test.php index 33cc80e74..9b75821f5 100644 --- a/_test/tests/inc/search/search.test.php +++ b/_test/tests/inc/search/search.test.php @@ -1,6 +1,7 @@ 0), 'ns1'); + $this->assertEquals(3, count($data)); + + //depth is 1 and we start too deep to expect results + $data = array(); + search($data, dirname(__FILE__) . '/data', 'search_allpages', array('depth' => 1), 'ns1/ns3'); + $this->assertEquals(0, count($data)); + + //depth is 1 so I should get only pages from ns1 + $data = array(); + search($data, dirname(__FILE__) . '/data', 'search_allpages', array('depth' => 1), 'ns1'); + $this->assertEquals(2, count($data)); + } + function test_search_index(){ + return; $data = array(); search($data, dirname(__FILE__) . '/data', 'search_index', array('ns' => 'ns2')); -- cgit v1.2.3