diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-25 17:55:51 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2016-03-25 17:55:51 +0100 |
commit | a3388622287e218beddfa14a47ed677d4307b36b (patch) | |
tree | 1b4c7ac8597b1cc798b6683d4a81c90d38de12f6 /tests/simple_unit/ActiveRecord/CriteriaTestCase.php | |
parent | c7fd3e1167b6f2fa7746edbd0fb8f8c1694c61f9 (diff) |
Removed simpletest and moved all tests in the unit tree
Tests are executed now, but a lot of them need fixing.
Diffstat (limited to 'tests/simple_unit/ActiveRecord/CriteriaTestCase.php')
-rw-r--r-- | tests/simple_unit/ActiveRecord/CriteriaTestCase.php | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php deleted file mode 100644 index a320f38c..00000000 --- a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -Prado::using('System.Data.ActiveRecord.TActiveRecord'); -require_once(dirname(__FILE__).'/records/DepartmentRecord.php'); -require_once(dirname(__FILE__).'/records/DepSections.php'); - -class CriteriaTestCase extends UnitTestCase -{ - function setup() - { - $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test'); - TActiveRecordManager::getInstance()->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'); - } - - function test_criteria_parameters() - { - $criteria = new TActiveRecordCriteria('sql', "One", "two", 3); - $expect = array("One", "two", 3); - $this->assertEqual($criteria->getParameters()->toArray(), $expect); - } - - function test_criteria_parameters_array() - { - $expect = array("One", "two", 3); - $criteria = new TActiveRecordCriteria('sql', $expect); - $this->assertEqual($criteria->getParameters()->toArray(), $expect); - } -} |