Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
startVulcain example
$stream
= StreamWrapper::
createResource
(
$response
,
$client
)
;
$this
->
assertSame
(
'Here the body',
stream_get_contents
(
$stream
)
)
;
rewind
(
$stream
)
;
$this
->
assertSame
(
'Here the body',
stream_get_contents
(
$stream
)
)
;
}
public
function
testHttp2PushVulcain
(
)
{
$client
=
$this
->
getHttpClient
(
__FUNCTION__
)
;
self::
startVulcain
(
$client
)
;
$logger
=
new
TestLogger
(
)
;
$client
->
setLogger
(
$logger
)
;
$responseAsArray
=
$client
->
request
(
'GET', 'https://127.0.0.1:3000/json',
[
'headers' =>
[
'Preload' => '/documents/*/id',
]
,
]
)
->
toArray
(
)
;
foreach
(
$responseAsArray
[
'documents'
]
as
$document
)
{
$client
->
request
(
'GET', 'https://127.0.0.1:3000'.
$document
[
'id'
]
)
->
toArray
(
)
;
}