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
5f4d92a1
Commit
5f4d92a1
authored
Jul 15, 2016
by
Steve Müller
Committed by
GitHub
Jul 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2443 from chrisguitarguy/fix_2440
Track the Values & Types Passed to Statement::bindParam
parents
17f50b86
2442c2b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
Statement.php
lib/Doctrine/DBAL/Statement.php
+3
-0
StatementTest.php
tests/Doctrine/Tests/DBAL/StatementTest.php
+23
-0
No files found.
lib/Doctrine/DBAL/Statement.php
View file @
5f4d92a1
...
...
@@ -138,6 +138,9 @@ class Statement implements \IteratorAggregate, DriverStatement
*/
public
function
bindParam
(
$name
,
&
$var
,
$type
=
PDO
::
PARAM_STR
,
$length
=
null
)
{
$this
->
params
[
$name
]
=
$var
;
$this
->
types
[
$name
]
=
$type
;
return
$this
->
stmt
->
bindParam
(
$name
,
$var
,
$type
,
$length
);
}
...
...
tests/Doctrine/Tests/DBAL/StatementTest.php
View file @
5f4d92a1
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL
;
use
Doctrine\DBAL\Statement
;
use
Doctrine\DBAL\Logging\SQLLogger
;
class
StatementTest
extends
\Doctrine\Tests\DbalTestCase
{
...
...
@@ -103,6 +104,28 @@ class StatementTest extends \Doctrine\Tests\DbalTestCase
$statement
->
execute
(
$values
);
}
public
function
testExecuteCallsStartQueryWithTheParametersBoundViaBindParam
()
{
$name
=
'foo'
;
$var
=
'bar'
;
$values
=
[
$name
=>
$var
];
$types
=
[
$name
=>
\PDO
::
PARAM_STR
];
$sql
=
''
;
$logger
=
$this
->
createMock
(
SQLLogger
::
class
);
$logger
->
expects
(
self
::
once
())
->
method
(
'startQuery'
)
->
with
(
self
::
equalTo
(
$sql
),
self
::
equalTo
(
$values
),
self
::
equalTo
(
$types
));
$this
->
configuration
->
expects
(
self
::
once
())
->
method
(
'getSQLLogger'
)
->
willReturn
(
$logger
);
$statement
=
new
Statement
(
$sql
,
$this
->
conn
);
$statement
->
bindParam
(
$name
,
$var
);
$statement
->
execute
();
}
/**
* @expectedException \Doctrine\DBAL\DBALException
*/
...
...
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