summaryrefslogtreecommitdiff
path: root/tests/simple_unit
diff options
context:
space:
mode:
authorwei <>2007-02-27 23:48:49 +0000
committerwei <>2007-02-27 23:48:49 +0000
commit7a9626af3bef5c712901597065745d9572c3f097 (patch)
treeb63b6c5ef530004ac40d57c2b58ddca773bea05d /tests/simple_unit
parent4c86659bc90d9134b0f901572c5417aa7d9cec18 (diff)
BC: Deprecate TActiveRecord::getRecordFinder() in favour of TActiveRecord::finder().
Diffstat (limited to 'tests/simple_unit')
-rw-r--r--tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php9
-rw-r--r--tests/simple_unit/ActiveRecord/records/Blogs.php7
-rw-r--r--tests/simple_unit/ActiveRecord/records/DepSections.php7
-rw-r--r--tests/simple_unit/ActiveRecord/records/DepartmentRecord.php7
-rw-r--r--tests/simple_unit/ActiveRecord/records/SimpleUser.php7
-rw-r--r--tests/simple_unit/ActiveRecord/records/SqliteUsers.php7
-rw-r--r--tests/simple_unit/ActiveRecord/records/UserRecord.php7
-rw-r--r--tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php4
8 files changed, 24 insertions, 31 deletions
diff --git a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
index 9e48fe5f..fbb1c927 100644
--- a/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
+++ b/tests/simple_unit/ActiveRecord/BaseActiveRecordTestCase.php
@@ -1,5 +1,4 @@
-<?php
-
+<?php
Prado::using('System.Data.ActiveRecord.TActiveRecord');
class BaseRecordTest extends TActiveRecord
@@ -11,14 +10,14 @@ class BaseActiveRecordTestCase extends UnitTestCase
{
function test_finder_returns_same_instance()
{
- $obj1 = TActiveRecord::getRecordFinder('BaseRecordTest');
- $obj2 = TActiveRecord::getRecordFinder('BaseRecordTest');
+ $obj1 = TActiveRecord::finder('BaseRecordTest');
+ $obj2 = TActiveRecord::finder('BaseRecordTest');
$this->assertIdentical($obj1,$obj2);
}
function test_finder_throw_exception_when_save()
{
- $obj = TActiveRecord::getRecordFinder('BaseRecordTest');
+ $obj = TActiveRecord::finder('BaseRecordTest');
try
{
$obj->save();
diff --git a/tests/simple_unit/ActiveRecord/records/Blogs.php b/tests/simple_unit/ActiveRecord/records/Blogs.php
index 69bdecd9..c32ca6b6 100644
--- a/tests/simple_unit/ActiveRecord/records/Blogs.php
+++ b/tests/simple_unit/ActiveRecord/records/Blogs.php
@@ -1,14 +1,13 @@
-<?php
-
+<?php
class Blogs extends TActiveRecord
{
public $blog_id;
public $blog_name;
public $blog_author;
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('Blogs');
+ return parent::finder($className);
}
}
diff --git a/tests/simple_unit/ActiveRecord/records/DepSections.php b/tests/simple_unit/ActiveRecord/records/DepSections.php
index 476371bd..c172245c 100644
--- a/tests/simple_unit/ActiveRecord/records/DepSections.php
+++ b/tests/simple_unit/ActiveRecord/records/DepSections.php
@@ -1,5 +1,4 @@
-<?php
-
+<?php
class DepSections extends TActiveRecord
{
public $department_id;
@@ -8,9 +7,9 @@ class DepSections extends TActiveRecord
public static $_tablename='department_sections';
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('DepSections');
+ return parent::finder($className);
}
}
diff --git a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php
index 64ab39d0..be0f5fd1 100644
--- a/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php
+++ b/tests/simple_unit/ActiveRecord/records/DepartmentRecord.php
@@ -1,5 +1,4 @@
-<?php
-
+<?php
class DepartmentRecord extends TActiveRecord
{
public $department_id;
@@ -10,9 +9,9 @@ class DepartmentRecord extends TActiveRecord
public static $_tablename = 'departments';
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('DepartmentRecord');
+ return parent::finder($className);
}
}
diff --git a/tests/simple_unit/ActiveRecord/records/SimpleUser.php b/tests/simple_unit/ActiveRecord/records/SimpleUser.php
index a256ffaf..3112e203 100644
--- a/tests/simple_unit/ActiveRecord/records/SimpleUser.php
+++ b/tests/simple_unit/ActiveRecord/records/SimpleUser.php
@@ -1,14 +1,13 @@
-<?php
-
+<?php
class SimpleUser extends TActiveRecord
{
public $username;
public static $_tablename='simple_users';
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('SimpleUser');
+ return parent::finder($className);
}
}
diff --git a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php
index 6a6b9be9..19940bc0 100644
--- a/tests/simple_unit/ActiveRecord/records/SqliteUsers.php
+++ b/tests/simple_unit/ActiveRecord/records/SqliteUsers.php
@@ -1,5 +1,4 @@
-<?php
-
+<?php
class SqliteUsers extends TActiveRecord
{
public $username;
@@ -8,9 +7,9 @@ class SqliteUsers extends TActiveRecord
public static $_tablename='users';
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('SqliteUsers');
+ return parent::finder($className);
}
}
diff --git a/tests/simple_unit/ActiveRecord/records/UserRecord.php b/tests/simple_unit/ActiveRecord/records/UserRecord.php
index 02534d6f..6ef0c637 100644
--- a/tests/simple_unit/ActiveRecord/records/UserRecord.php
+++ b/tests/simple_unit/ActiveRecord/records/UserRecord.php
@@ -1,5 +1,4 @@
-<?php
-
+<?php
class UserRecord extends TActiveRecord
{
public $username;
@@ -30,9 +29,9 @@ class UserRecord extends TActiveRecord
$this->_level=TPropertyValue::ensureInteger($level);
}
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('UserRecord');
+ return parent::finder($className);
}
}
diff --git a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php
index 9dc944f5..1f018a02 100644
--- a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php
+++ b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php
@@ -16,9 +16,9 @@ class ActiveAccount extends TActiveRecord
private static $_tablename='Accounts';
- public static function finder()
+ public static function finder($className=__CLASS__)
{
- return self::getRecordFinder('ActiveAccount');
+ return parent::finder($className);
}
}