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/ActiveRecordDynamicCallTestCase.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/ActiveRecordDynamicCallTestCase.php')
-rw-r--r-- | tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php deleted file mode 100644 index 58c9977a..00000000 --- a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php +++ /dev/null @@ -1,67 +0,0 @@ -<?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); - } -} |