diff --git a/module/search/test/lib/zen.class.php b/module/search/test/lib/zen.class.php index 5d82ffc991..565da6a9ac 100644 --- a/module/search/test/lib/zen.class.php +++ b/module/search/test/lib/zen.class.php @@ -20,4 +20,17 @@ class searchZenTest extends baseTest if(dao::isError()) return dao::getError(); return $result; } + + /** + * Test setOptionAndOr method. + * + * @access public + * @return mixed + */ + public function setOptionAndOrTest() + { + $result = $this->invokeArgs('setOptionAndOr'); + if(dao::isError()) return dao::getError(); + return $result; + } } diff --git a/module/search/test/zen/setoptionandor.php b/module/search/test/zen/setoptionandor.php new file mode 100755 index 0000000000..436b388aab --- /dev/null +++ b/module/search/test/zen/setoptionandor.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +setOptionAndOrTest(); +$result2 = $searchTest->setOptionAndOrTest(); +$result3 = $searchTest->setOptionAndOrTest(); +$result4 = $searchTest->setOptionAndOrTest(); +$result5 = $searchTest->setOptionAndOrTest(); +$result6 = $searchTest->setOptionAndOrTest(); + +r(is_array($result1)) && p() && e('1'); +r(count($result2)) && p() && e('2'); +r($result3) && p('0:value') && e('and'); +r($result4) && p('0:title') && e('并且'); +r($result5) && p('1:value') && e('or'); +r($result6) && p('1:title') && e('或者'); \ No newline at end of file