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
93285531
Commit
93285531
authored
Oct 31, 2009
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] DDC-62 - Fixed bug with proxy class generation of non-namespaced entities
parent
a05bd5e2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
ProxyFactory.php
lib/Doctrine/ORM/Proxy/ProxyFactory.php
+8
-1
ProxyClassGeneratorTest.php
tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php
+19
-3
NonNamespacedProxies.php
...octrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php
+13
-0
No files found.
lib/Doctrine/ORM/Proxy/ProxyFactory.php
View file @
93285531
...
...
@@ -135,9 +135,16 @@ class ProxyFactory
'<methods>'
,
'<sleepImpl>'
,
'<constructorInvocation>'
);
if
(
substr
(
$class
->
name
,
0
,
1
)
==
"
\\
"
)
{
$className
=
substr
(
$class
->
name
,
1
);
}
else
{
$className
=
$class
->
name
;
}
$replacements
=
array
(
$this
->
_proxyNamespace
,
$proxyClassName
,
$class
->
n
ame
,
$proxyClassName
,
$class
N
ame
,
$methods
,
$sleepImpl
,
$constructorInv
);
...
...
tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php
View file @
93285531
...
...
@@ -23,6 +23,10 @@ class ProxyClassGeneratorTest extends \Doctrine\Tests\OrmTestCase
private
$_connectionMock
;
private
$_uowMock
;
private
$_emMock
;
/**
* @var \Doctrine\ORM\Proxy\ProxyFactory
*/
private
$_proxyFactory
;
protected
function
setUp
()
...
...
@@ -103,10 +107,22 @@ class ProxyClassGeneratorTest extends \Doctrine\Tests\OrmTestCase
$this
->
assertNotEquals
(
$referenceProxyClass
,
$associationProxyClass
);
}
p
rotected
function
_getAssociationMock
()
p
ublic
function
testNonNamespacedProxyGeneration
()
{
$assoc
=
$this
->
getMock
(
'Doctrine\ORM\Mapping\AssociationMapping'
,
array
(
'load'
),
array
(),
''
,
false
,
false
,
false
);
return
$assoc
;
require_once
dirname
(
__FILE__
)
.
"/fixtures/NonNamespacedProxies.php"
;
$className
=
"\DoctrineOrmTestEntity"
;
$proxyName
=
"DoctrineOrmTestEntityProxy"
;
$classMetadata
=
new
\Doctrine\ORM\Mapping\ClassMetadata
(
$className
);
$classMetadata
->
mapField
(
array
(
'fieldName'
=>
'id'
,
'type'
=>
'integer'
));
$classMetadata
->
setIdentifier
(
array
(
'id'
));
$this
->
_proxyFactory
->
generateProxyClasses
(
array
(
$classMetadata
));
$classCode
=
file_get_contents
(
dirname
(
__FILE__
)
.
"/generated/"
.
$proxyName
.
".php"
);
$this
->
assertNotContains
(
"class DoctrineOrmTestEntityProxy extends
\\\\
DoctrineOrmTestEntity"
,
$classCode
);
$this
->
assertContains
(
"class DoctrineOrmTestEntityProxy extends
\\
DoctrineOrmTestEntity"
,
$classCode
);
}
protected
function
_getMockPersister
()
...
...
tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php
0 → 100644
View file @
93285531
<?php
/**
* @entity
*/
class
DoctrineOrmTestEntity
{
/**
* @column(type="integer")
* @id
*/
public
$id
;
}
\ 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