summaryrefslogtreecommitdiff
path: root/tests/simple_unit/ActiveRecord/RecordEventTestCase.php
diff options
context:
space:
mode:
authorwei <>2007-04-12 08:05:03 +0000
committerwei <>2007-04-12 08:05:03 +0000
commitdc3bf922d9715bfd1b2105be04a9aabc84a1d7d4 (patch)
treeff97362f718b6ebb482128527402efe03fe1ac43 /tests/simple_unit/ActiveRecord/RecordEventTestCase.php
parent6178a99df0c722581bc61e35559ac5f8af1cc6e8 (diff)
Refactor and add TTableGateway, System.Data.Common, System.Data.DataGateway
Diffstat (limited to 'tests/simple_unit/ActiveRecord/RecordEventTestCase.php')
-rw-r--r--tests/simple_unit/ActiveRecord/RecordEventTestCase.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/simple_unit/ActiveRecord/RecordEventTestCase.php b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php
new file mode 100644
index 00000000..c669bb72
--- /dev/null
+++ b/tests/simple_unit/ActiveRecord/RecordEventTestCase.php
@@ -0,0 +1,33 @@
+<?php
+Prado::using('System.Data.ActiveRecord.TActiveRecord');
+require_once(dirname(__FILE__).'/records/UserRecord.php');
+
+class RecordEventTestCase extends UnitTestCase
+{
+ function setup()
+ {
+ $conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test');
+ TActiveRecordManager::getInstance()->setDbConnection($conn);
+ }
+
+ function testFindByPk()
+ {
+ $user1 = UserRecord::finder()->findByPk('admin');
+ $this->assertNotNull($user1);
+ }
+
+ function test_same_data_returns_same_object()
+ {
+ $criteria = new TActiveRecordCriteria('username = ?', 'admin');
+ $criteria->OnSelect = array($this, 'logger');
+ $user1 = UserRecord::finder()->find($criteria);
+ //var_dump($user1);
+ }
+
+ function logger($sender, $param)
+ {
+ var_dump($param->Command->Text);
+ }
+}
+
+?> \ No newline at end of file