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
174b507d
Commit
174b507d
authored
Sep 19, 2007
by
gnat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new relation save test
parent
19de41b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
OneToOneTestCase.php
tests/Relation/OneToOneTestCase.php
+19
-2
No files found.
tests/Relation/OneToOneTestCase.php
View file @
174b507d
...
...
@@ -36,17 +36,19 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'Record_City'
,
'Record_Country'
,
'SelfRefTest'
);
$this
->
tables
=
array
(
'
gnatUser'
,
'Email'
,
'Entity'
,
'
Record_City'
,
'Record_Country'
,
'SelfRefTest'
);
parent
::
prepareTables
();
}
public
function
testOneToOneAggregateRelationWithAliasesIsSupported
()
public
function
testOneToOneAggregateRelationWithAliasesIsSupported
()
{
$city
=
new
Record_City
();
$country
=
$city
->
Country
;
$this
->
assertTrue
(
$country
instanceof
Record_Country
);
}
public
function
testSelfReferentialOneToOneRelationsAreSupported
()
{
$ref
=
new
SelfRefTest
();
...
...
@@ -83,4 +85,19 @@ class Doctrine_Relation_OneToOne_TestCase extends Doctrine_UnitTestCase
$user
->
save
();
$this
->
assertTrue
(
$user
->
Email
instanceOf
Doctrine_Null
);
}
public
function
testSavingRelatedObjects
()
{
$user
=
new
gnatUser
();
$user
->
name
=
"test"
;
$email
=
new
Email
();
$email
->
address
=
"test@test.com"
;
$user
->
Email
=
$email
;
$user
->
save
();
$this
->
assertTrue
(
$user
->
Email
instanceOf
Email
);
$this
->
assertTrue
(
$user
->
email_id
!=
0
);
$this
->
assertTrue
(
$user
->
email_id
!=
null
);
$this
->
assertTrue
(
$user
->
email_id
==
$user
->
Email
->
id
);
}
}
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