summaryrefslogtreecommitdiff
path: root/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-12 11:21:01 +0000
committerctrlaltca <>2012-07-12 11:21:01 +0000
commit903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch)
treee08bf04f0823650a231227ac3499121270172a23 /tests/simple_unit/ActiveRecord/CriteriaTestCase.php
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'tests/simple_unit/ActiveRecord/CriteriaTestCase.php')
-rw-r--r--tests/simple_unit/ActiveRecord/CriteriaTestCase.php98
1 files changed, 49 insertions, 49 deletions
diff --git a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
index 17f691d7..de5b3b71 100644
--- a/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
+++ b/tests/simple_unit/ActiveRecord/CriteriaTestCase.php
@@ -1,50 +1,50 @@
-<?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);
- }
-}
-
+<?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);
+ }
+}
+
?> \ No newline at end of file