Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
81b394cd
Commit
81b394cd
authored
Feb 11, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more experiments with the new testsuite.
parent
fd1fb574
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
TestTest.php
tests/Orm/Component/TestTest.php
+1
-1
users.php
tests/fixtures/forum/common/users.php
+4
-2
ForumUser.php
tests/models/forum/ForumUser.php
+6
-2
No files found.
tests/Orm/Component/TestTest.php
View file @
81b394cd
...
...
@@ -6,7 +6,7 @@ class Orm_Component_TestTest extends Doctrine_OrmTestCase
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
loadFixture
(
'forum'
,
'common'
,
'users'
);
$this
->
loadFixture
s
(
'forum'
,
'common'
,
array
(
'users'
,
'admins'
)
);
}
public
function
testTest
()
...
...
tests/fixtures/forum/common/users.php
View file @
81b394cd
...
...
@@ -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'
)
)
);
\ No newline at end of file
tests/models/forum/ForumUser.php
View file @
81b394cd
...
...
@@ -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
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment