Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createDetailRequest example
->
build
(
)
;
$this
->
getContainer
(
)
->
get
(
'product.repository'
)
->
create
(
[
$products
]
, Context::
createDefaultContext
(
)
)
;
$context
=
$this
->
getContainer
(
)
->
get
(
SalesChannelContextFactory::
class
)
->
create
(
Uuid::
randomHex
(
)
, TestDefaults::SALES_CHANNEL
)
;
$controller
=
$this
->
getContainer
(
)
->
get
(
ProductController::
class
)
;
if
(
$shouldThrowException
)
{
static
::
expectException
(
ProductNotFoundException::
class
)
;
}
$response
=
$controller
->
index
(
$context
,
$this
->
createDetailRequest
(
$context
,
$this
->ids->
get
(
$requestVariant
)
)
)
;
static
::
assertSame
(
Response::HTTP_OK,
$response
->
getStatusCode
(
)
)
;
$crawler
=
new
Crawler
(
)
;
$crawler
->
addHtmlContent
(
(string)
$response
->
getContent
(
)
)
;
$blueFound
= false;
$greenFound
= false;
$redFound
= false;
$xlFound
= false;
$lFound
= false;