1
0
mirror of synced 2025-03-19 22:43:58 +03:00

more experiments with the new testsuite.

This commit is contained in:
romanb 2008-02-11 22:33:12 +00:00
parent fd1fb5742d
commit 81b394cd02
3 changed files with 11 additions and 5 deletions

View File

@ -6,7 +6,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase
protected function setUp()
{
parent::setUp();
$this->loadFixture('forum', 'common', 'users');
$this->loadFixtures('forum', 'common', array('users', 'admins'));
}
public function testTest()

View File

@ -4,11 +4,13 @@ $fixture = array(
'rows' => array(
array(
'id' => 1,
'username' => 'romanb'
'username' => 'romanb',
'dtype' => 'admin'
),
array(
'id' => 2,
'username' => 'jwage'
'username' => 'jwage',
'dtype' => 'user'
)
)
);

View File

@ -8,15 +8,19 @@ class ForumUser extends Doctrine_Record
$class->setInheritanceType(Doctrine::INHERITANCETYPE_JOINED, array(
'discriminatorColumn' => 'dtype',
'discriminatorMap' => array(
1 => 'ForumUser',
2 => 'ForumAdministrator')
'user' => 'ForumUser',
'admin' => 'ForumAdministrator')
));
$class->setSubclasses(array('ForumAdministrator'));
// the discriminator column
$class->addMappedColumn('dtype', 'string', 50);
// property mapping
$class->addMappedColumn('id', 'integer', 4, array(
'primary' => true,
'autoincrement' => true));
$class->addMappedColumn('username', 'string', 50);
}
}