summaryrefslogtreecommitdiff
path: root/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php')
-rw-r--r--tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
new file mode 100644
index 00000000..9e48fe5f
--- /dev/null
+++ b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
@@ -0,0 +1,34 @@
+<?php
+
+Prado::using('System.Data.ActiveRecord.TActiveRecord');
+
+class BaseRecordTest extends TActiveRecord
+{
+
+}
+
+class BaseActiveRecordTestCase extends UnitTestCase
+{
+ function test_finder_returns_same_instance()
+ {
+ $obj1 = TActiveRecord::getRecordFinder('BaseRecordTest');
+ $obj2 = TActiveRecord::getRecordFinder('BaseRecordTest');
+ $this->assertIdentical($obj1,$obj2);
+ }
+
+ function test_finder_throw_exception_when_save()
+ {
+ $obj = TActiveRecord::getRecordFinder('BaseRecordTest');
+ try
+ {
+ $obj->save();
+ $this->fail();
+ }
+ catch(TActiveRecordException $e)
+ {
+ $this->pass();
+ }
+ }
+}
+
+?> \ No newline at end of file