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
8336bcc7
Commit
8336bcc7
authored
Jan 27, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] DDC-279 - Commit testcase that shows it works.
parent
4e3edec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
0 deletions
+130
-0
DDC279Test.php
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php
+130
-0
No files found.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php
0 → 100644
View file @
8336bcc7
<?php
namespace
Doctrine\Tests\ORM\Functional\Ticket
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
class
DDC279Test
extends
\Doctrine\Tests\OrmFunctionalTestCase
{
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
_schemaTool
->
createSchema
(
array
(
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC279EntityX'
),
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC279EntityY'
),
$this
->
_em
->
getClassMetadata
(
__NAMESPACE__
.
'\DDC279EntityZ'
)
));
}
/**
* @group DDC-279
*/
public
function
testDDC279
()
{
$x
=
new
DDC279EntityX
();
$y
=
new
DDC279EntityY
();
$z
=
new
DDC279EntityZ
();
$x
->
data
=
'X'
;
$y
->
data
=
'Y'
;
$z
->
data
=
'Z'
;
$x
->
y
=
$y
;
$y
->
z
=
$z
;
$this
->
_em
->
persist
(
$x
);
$this
->
_em
->
persist
(
$y
);
$this
->
_em
->
persist
(
$z
);
$this
->
_em
->
flush
();
$this
->
_em
->
clear
();
$result
=
$this
->
_em
->
createQuery
(
'SELECT x, y, z FROM Doctrine\Tests\ORM\Functional\Ticket\DDC279EntityX x '
.
'INNER JOIN x.y y INNER JOIN y.z z WHERE x.id = 1'
)
->
getArrayResult
();
$expected
=
array
(
0
=>
array
(
'id'
=>
1
,
'data'
=>
'X'
,
'y'
=>
array
(
'id'
=>
1
,
'data'
=>
'Y'
,
'z'
=>
array
(
'id'
=>
1
,
'data'
=>
'Z'
,
)
),
),
);
$this
->
assertEquals
(
$expected
,
$result
);
}
}
/**
* @Entity
*/
class
DDC279EntityX
{
/**
* @Id
* @generatedValue(strategy="AUTO")
* @Column(name="id", type="integer")
*/
public
$id
;
/**
* @column(type="string")
*/
public
$data
;
/**
* @OneToOne(targetEntity="Doctrine\Tests\ORM\Functional\Ticket\DDC279EntityY")
* @JoinColumn(name="y_id", referencedColumnName="id")
*/
public
$y
;
}
/**
* @Entity
*/
class
DDC279EntityY
{
/**
* @Id
* @generatedValue(strategy="AUTO")
* @Column(name="id", type="integer")
*/
public
$id
;
/**
* @column(type="string")
*/
public
$data
;
/**
* @OneToOne(targetEntity="Doctrine\Tests\ORM\Functional\Ticket\DDC279EntityZ")
* @JoinColumn(name="z_id", referencedColumnName="id")
*/
public
$z
;
}
/**
* @Entity
*/
class
DDC279EntityZ
{
/**
* @Id
* @generatedValue(strategy="AUTO")
* @Column(name="id", type="integer")
*/
public
$id
;
/**
* @column(type="string")
*/
public
$data
;
}
\ 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