diff options
author | ctrlaltca <> | 2012-07-12 11:21:01 +0000 |
---|---|---|
committer | ctrlaltca <> | 2012-07-12 11:21:01 +0000 |
commit | 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch) | |
tree | e08bf04f0823650a231227ac3499121270172a23 /tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php | |
parent | 3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff) |
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php')
-rw-r--r-- | tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php index 07e810aa..8d7fa46a 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php @@ -1,69 +1,69 @@ -<?php
-Prado::using('System.Data.ActiveRecord.TActiveRecord');
-require_once(dirname(__FILE__).'/records/DepartmentRecord.php');
-require_once(dirname(__FILE__).'/records/DepSections.php');
-
-class ActiveRecordDynamicCallTestCase extends UnitTestCase
-{
- function setup()
- {
- $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test');
- TActiveRecordManager::getInstance()->setDbConnection($conn);
- }
-
- function test_multiple_field_and_or()
- {
- $finder = DepartmentRecord::finder();
- $r2 = $finder->findAllByName_And_Description_Or_Active_Or_Order('Facilities', null, false, 1);
- $this->assertNotNull($r2);
- }
-
- function test_dynamic_call()
- {
- $finder = DepartmentRecord::finder();
- $r2 = $finder->findByName('Facilities');
- $this->assertNotNull($r2);
- }
-
- function test_dynamic_multiple_field_call()
- {
- $finder = DepartmentRecord::finder();
- $rs = $finder->findByNameAndActive('Marketing',true);
- $this->assertNotNull($rs);
- }
-
- function test_dynamic_call_missing_parameters_throws_exception()
- {
- $finder = DepartmentRecord::finder();
- try
- {
- $rs = $finder->findByNameAndActive('Marketing');
- $this->fail();
- }
- catch(TDbException $e)
- {
- $this->pass();
- }
- }
-
- function test_dynamic_call_extras_parameters_ok()
- {
- $finder = DepartmentRecord::finder();
- $rs = $finder->findByNameAndActive('Marketing',true,true);
- $this->assertNotNull($rs);
- }
-
- function test_dynamic_delete_by()
- {
- $finder = DepartmentRecord::finder();
- //$finder->RecordManager->OnDelete[] = array($this, 'assertDeleteSql');
- $this->assertEqual($finder->deleteByName('tasds'), 0);
- }
-
- function assertDeleteSql($sender, $param)
- {
- var_dump($param);
- }
-}
+<?php +Prado::using('System.Data.ActiveRecord.TActiveRecord'); +require_once(dirname(__FILE__).'/records/DepartmentRecord.php'); +require_once(dirname(__FILE__).'/records/DepSections.php'); + +class ActiveRecordDynamicCallTestCase extends UnitTestCase +{ + function setup() + { + $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test'); + TActiveRecordManager::getInstance()->setDbConnection($conn); + } + + function test_multiple_field_and_or() + { + $finder = DepartmentRecord::finder(); + $r2 = $finder->findAllByName_And_Description_Or_Active_Or_Order('Facilities', null, false, 1); + $this->assertNotNull($r2); + } + + function test_dynamic_call() + { + $finder = DepartmentRecord::finder(); + $r2 = $finder->findByName('Facilities'); + $this->assertNotNull($r2); + } + + function test_dynamic_multiple_field_call() + { + $finder = DepartmentRecord::finder(); + $rs = $finder->findByNameAndActive('Marketing',true); + $this->assertNotNull($rs); + } + + function test_dynamic_call_missing_parameters_throws_exception() + { + $finder = DepartmentRecord::finder(); + try + { + $rs = $finder->findByNameAndActive('Marketing'); + $this->fail(); + } + catch(TDbException $e) + { + $this->pass(); + } + } + + function test_dynamic_call_extras_parameters_ok() + { + $finder = DepartmentRecord::finder(); + $rs = $finder->findByNameAndActive('Marketing',true,true); + $this->assertNotNull($rs); + } + + function test_dynamic_delete_by() + { + $finder = DepartmentRecord::finder(); + //$finder->RecordManager->OnDelete[] = array($this, 'assertDeleteSql'); + $this->assertEqual($finder->deleteByName('tasds'), 0); + } + + function assertDeleteSql($sender, $param) + { + var_dump($param); + } +} ?>
\ No newline at end of file |