From 45b0fe42a979d444d547a5248eb2e9e915aaf16a Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 14 Jan 2007 02:10:24 +0000 Subject: Add "block-content" to allow user comments on block level elements in quickstart docs. --- .../simple_unit/ActiveRecord/CriteriaTestCase.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/simple_unit/ActiveRecord/CriteriaTestCase.php (limited to 'tests/simple_unit/ActiveRecord/CriteriaTestCase.php') diff --git a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php new file mode 100644 index 00000000..f1545e1d --- /dev/null +++ b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php @@ -0,0 +1,36 @@ +setDbConnection($conn); + } + + function test_orderby_only() + { + $criteria = new TActiveRecordCriteria; + $criteria->OrdersBy['name'] = 'asc'; + $records = DepartmentRecord::finder()->findAll($criteria); + $this->assertEqual(count($records), 8); + $this->assertEqual($records[0]->name, '+GX Service'); + $this->assertEqual($records[7]->name, 'Marketing'); + } + + function test_orderby_only_desc() + { + $criteria = new TActiveRecordCriteria; + $criteria->OrdersBy['name'] = 'desc'; + $records = DepartmentRecord::finder()->findAll($criteria); + $this->assertEqual(count($records), 8); + $this->assertEqual($records[7]->name, '+GX Service'); + $this->assertEqual($records[0]->name, 'Marketing'); + } +} + +?> \ No newline at end of file -- cgit v1.2.3