From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../ActiveRecord/DeleteByPkTestCase.php | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php') diff --git a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php index 45415b90..f848033c 100644 --- a/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php +++ b/tests/simple_unit/ActiveRecord/DeleteByPkTestCase.php @@ -1,31 +1,31 @@ setDbConnection($conn); - } - - function test_delete_by_pks() - { - $finder = DepartmentRecord::finder(); - $this->assertEqual($finder->deleteByPk(100),0); - $this->assertEqual($finder->deleteByPk(100, 101),0); - $this->assertEqual($finder->deleteByPk(array(100, 101)),0); - } - - function test_delete_by_composite_pks() - { - $finder = DepSections::finder(); - $this->assertEqual($finder->deleteByPk(array(100,101)),0); - $this->assertEqual($finder->deleteByPk(array(100, 101), array(102, 103)),0); - $this->assertEqual($finder->deleteByPk(array(array(100, 101), array(102, 103))),0); - } + +Prado::using('System.Data.ActiveRecord.TActiveRecord'); +require_once(dirname(__FILE__).'/records/DepartmentRecord.php'); +require_once(dirname(__FILE__).'/records/DepSections.php'); + +class DeleteByPkTestCase extends UnitTestCase +{ + function setup() + { + $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test'); + TActiveRecordManager::getInstance()->setDbConnection($conn); + } + + function test_delete_by_pks() + { + $finder = DepartmentRecord::finder(); + $this->assertEqual($finder->deleteByPk(100),0); + $this->assertEqual($finder->deleteByPk(100, 101),0); + $this->assertEqual($finder->deleteByPk(array(100, 101)),0); + } + + function test_delete_by_composite_pks() + { + $finder = DepSections::finder(); + $this->assertEqual($finder->deleteByPk(array(100,101)),0); + $this->assertEqual($finder->deleteByPk(array(100, 101), array(102, 103)),0); + $this->assertEqual($finder->deleteByPk(array(array(100, 101), array(102, 103))),0); + } } ?> \ No newline at end of file -- cgit v1.2.3