Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setSearchReturn example
public
function
testGroupRegistrationAcceptMatches
(
?int
$expectedResCode
, ?array
$customers
, Request
$request
, ?string
$errorMessage
)
: void
{
$context
= Context::
createDefaultContext
(
)
;
if
(
$customers
!== null
)
{
$customerCollection
=
new
CustomerCollection
(
$customers
)
;
$this
->
setRestorerReturn
(
)
;
$this
->
setSearchReturn
(
$context
,
$customerCollection
)
;
$this
->
setCustomerGroupSearchReturn
(
$context
)
;
}
if
(
$errorMessage
!== null &&
$expectedResCode
=== null
)
{
static
::
expectExceptionMessage
(
$errorMessage
)
;
}
$res
=
$this
->controllerMock->
accept
(
$request
,
$context
)
;
static
::
assertSame
(
$expectedResCode
,
$res
->
getStatusCode
(
)
)
;
}