Commit 81b394cd authored by romanb's avatar romanb

more experiments with the new testsuite.

parent fd1fb574
...@@ -6,7 +6,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase ...@@ -6,7 +6,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();
$this->loadFixture('forum', 'common', 'users'); $this->loadFixtures('forum', 'common', array('users', 'admins'));
} }
public function testTest() public function testTest()
......
...@@ -4,11 +4,13 @@ $fixture = array( ...@@ -4,11 +4,13 @@ $fixture = array(
'rows' => array( 'rows' => array(
array( array(
'id' => 1, 'id' => 1,
'username' => 'romanb' 'username' => 'romanb',
'dtype' => 'admin'
), ),
array( array(
'id' => 2, 'id' => 2,
'username' => 'jwage' 'username' => 'jwage',
'dtype' => 'user'
) )
) )
); );
\ No newline at end of file
...@@ -8,15 +8,19 @@ class ForumUser extends Doctrine_Record ...@@ -8,15 +8,19 @@ class ForumUser extends Doctrine_Record
$class->setInheritanceType(Doctrine::INHERITANCETYPE_JOINED, array( $class->setInheritanceType(Doctrine::INHERITANCETYPE_JOINED, array(
'discriminatorColumn' => 'dtype', 'discriminatorColumn' => 'dtype',
'discriminatorMap' => array( 'discriminatorMap' => array(
1 => 'ForumUser', 'user' => 'ForumUser',
2 => 'ForumAdministrator') 'admin' => 'ForumAdministrator')
)); ));
$class->setSubclasses(array('ForumAdministrator')); $class->setSubclasses(array('ForumAdministrator'));
// the discriminator column
$class->addMappedColumn('dtype', 'string', 50);
// property mapping // property mapping
$class->addMappedColumn('id', 'integer', 4, array( $class->addMappedColumn('id', 'integer', 4, array(
'primary' => true, 'primary' => true,
'autoincrement' => true)); 'autoincrement' => true));
$class->addMappedColumn('username', 'string', 50); $class->addMappedColumn('username', 'string', 50);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment