more experiments with the new testsuite.
This commit is contained in:
parent
fd1fb5742d
commit
81b394cd02
@ -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()
|
||||
|
6
tests/fixtures/forum/common/users.php
vendored
6
tests/fixtures/forum/common/users.php
vendored
@ -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'
|
||||
)
|
||||
)
|
||||
);
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user