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
f2213c4d
Commit
f2213c4d
authored
May 10, 2010
by
Christian Heinrich
Committed by
Roman S. Borschel
May 11, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #DDC-578
Also added a new testcase
parent
f9b53c6b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
10 deletions
+28
-10
ProxyFactory.php
lib/Doctrine/ORM/Proxy/ProxyFactory.php
+5
-1
ForumEntry.php
tests/Doctrine/Tests/Models/Forum/ForumEntry.php
+4
-0
ProxyClassGeneratorTest.php
tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php
+19
-9
No files found.
lib/Doctrine/ORM/Proxy/ProxyFactory.php
View file @
f2213c4d
...
...
@@ -164,7 +164,11 @@ class ProxyFactory
}
if
(
$method
->
isPublic
()
&&
!
$method
->
isFinal
()
&&
!
$method
->
isStatic
())
{
$methods
.=
PHP_EOL
.
' public function '
.
$method
->
getName
()
.
'('
;
$methods
.=
PHP_EOL
.
' public function '
;
if
(
$method
->
returnsReference
())
{
$methods
.=
'&'
;
}
$methods
.=
$method
->
getName
()
.
'('
;
$firstParam
=
true
;
$parameterString
=
$argumentString
=
''
;
...
...
tests/Doctrine/Tests/Models/Forum/ForumEntry.php
View file @
f2213c4d
...
...
@@ -18,5 +18,9 @@ class ForumEntry
* @Column(type="string", length=50)
*/
public
$topic
;
public
function
&
getTopicByReference
()
{
return
$this
->
topic
;
}
}
tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php
View file @
f2213c4d
...
...
@@ -95,6 +95,16 @@ class ProxyClassGeneratorTest extends \Doctrine\Tests\OrmTestCase
$this
->
assertEquals
(
'Doctrine\Tests\Models\ECommerce\ECommerceProduct'
,
$params
[
0
]
->
getClass
()
->
getName
());
}
/**
* Test that the proxy behaves in regard to methods like &foo() correctly
*/
public
function
testProxyRespectsMethodsWhichReturnValuesByReference
()
{
$proxy
=
$this
->
_proxyFactory
->
getProxy
(
'Doctrine\Tests\Models\Forum\ForumEntry'
,
null
);
$method
=
new
\ReflectionMethod
(
get_class
(
$proxy
),
'getTopicByReference'
);
$this
->
assertTrue
(
$method
->
returnsReference
());
}
public
function
testCreatesAssociationProxyAsSubclassOfTheOriginalOne
()
{
$proxyClass
=
'Proxies\DoctrineTestsModelsECommerceECommerceFeatureProxy'
;
...
...
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