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
6e4e45e1
Commit
6e4e45e1
authored
Jan 06, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DDC-233 - Fixed use of array_merge() because it re-assigns the numerical indexes from 0 on.
parent
375c470e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
AbstractQuery.php
lib/Doctrine/ORM/AbstractQuery.php
+1
-1
QueryTest.php
tests/Doctrine/Tests/ORM/Functional/QueryTest.php
+13
-0
No files found.
lib/Doctrine/ORM/AbstractQuery.php
View file @
6e4e45e1
...
...
@@ -154,7 +154,7 @@ abstract class AbstractQuery
public
function
getParameters
(
$params
=
array
())
{
if
(
$params
)
{
return
array_merge
(
$this
->
_params
,
$params
);
return
(
$this
->
_params
+
$params
);
}
return
$this
->
_params
;
}
...
...
tests/Doctrine/Tests/ORM/Functional/QueryTest.php
View file @
6e4e45e1
...
...
@@ -29,6 +29,19 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query
->
execute
(
array
(
42
));
// same as array(0 => 42), 0 is invalid parameter position
}
public
function
testGetParameters
()
{
$query
=
$this
->
_em
->
createQuery
(
"select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"
);
$this
->
assertEquals
(
array
(
1
=>
42
),
$query
->
getParameters
(
array
(
1
=>
42
)));
}
public
function
testGetParameters_HasSomeAlready
()
{
$query
=
$this
->
_em
->
createQuery
(
"select u from Doctrine\Tests\Models\CMS\CmsUser u where u.username = ?1"
);
$query
->
setParameter
(
2
,
84
);
$this
->
assertEquals
(
array
(
2
=>
84
,
1
=>
42
),
$query
->
getParameters
(
array
(
1
=>
42
)));
}
public
function
testSimpleQueries
()
{
$user
=
new
CmsUser
;
...
...
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