Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CliDumper example
$c
=
$this
->
createCollector
(
$queries
)
;
$c
->
lateCollect
(
)
;
$c
=
unserialize
(
serialize
(
$c
)
)
;
$collectedQueries
=
$c
->
getQueries
(
)
;
$collectedParam
=
$collectedQueries
[
'default'
]
[
0
]
[
'params'
]
[
0
]
;
if
(
$collectedParam
instanceof Data
)
{
$out
=
fopen
(
'php://memory', 'r+b'
)
;
\
assert
(
\
is_resource
(
$out
)
)
;
$dumper
=
new
CliDumper
(
)
;
$dumper
->
setColors
(
false
)
;
$collectedParam
->
dump
(
$dumper
)
;
static
::
assertStringMatchesFormat
(
$expected
,
print_r
(
stream_get_contents
(
$out
, -1, 0
)
, true
)
)
;
}
elseif
(
\
is_string
(
$expected
)
)
{
static
::
assertStringMatchesFormat
(
$expected
,
$collectedParam
)
;
}
else
{
static
::
assertEquals
(
$expected
,
$collectedParam
)
;
}
static
::
assertTrue
(
$collectedQueries
[
'default'
]
[
0
]
[
'explainable'
]
)
;
static
::
assertTrue
(
$collectedQueries
[
'default'
]
[
0
]
[
'runnable'
]
)
;
}