Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ArrayStatement example
// dbal 2.x
if
(
interface_exists
(
Result::
class
)
)
{
$driverConnection
->
expects
(
self::
exactly
(
2
)
)
->
method
(
'getWrappedConnection'
)
->
willReturn
(
$wrappedConnection
)
;
$driverConnection
->
expects
(
self::
any
(
)
)
->
method
(
'executeQuery'
)
->
willReturn
(
new
ArrayStatement
(
[
]
)
)
;
}
else
{
// dbal 3.x
$driverConnection
->
expects
(
self::
exactly
(
2
)
)
->
method
(
'getNativeConnection'
)
->
willReturn
(
$wrappedConnection
)
;
$driverConnection
->
expects
(
self::
any
(
)
)
->
method
(
'executeQuery'
)
->
willReturn
(
new
Result
(
new
ArrayResult
(
[
]
)
,
$driverConnection
)
)
;
}