Example #1
0
 public function test_greater_less_search()
 {
     $page = Page::find_by_position(1);
     $matches = Page::find(array('position_less_than' => 2));
     FuzzyTest::assert_equal(count($matches), 1, "Should find one page here");
     $matches = Page::find_all_by_position_less_than(2);
     FuzzyTest::assert_equal(count($matches), 1, "Should find one page here");
     $matches = Page::find(array('position_greater_than' => 2));
     FuzzyTest::assert_equal(count($matches), 1, "Should find one page here");
     $matches = Page::find_all_by_position_greater_than(2);
     FuzzyTest::assert_equal(count($matches), 1, "Should find one page here");
     $matches = Page::find_all_by_position_greater_than_and_position_less_than(1, 3);
     FuzzyTest::assert_equal(count($matches), 1, "Should find one page here");
 }