Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
RequirementsController example
->
with
(
'@Installer/installer/requirements.html.twig',
array_merge
(
$this
->
getDefaultViewParams
(
)
,
[
'requirementChecks' =>
$checks
,
]
)
)
->
willReturn
(
'checks'
)
;
$jwtCertificateGenerator
=
$this
->
createMock
(
JwtCertificateGenerator::
class
)
;
$jwtCertificateGenerator
->
expects
(
static
::
never
(
)
)
->
method
(
'generate'
)
;
$controller
=
new
RequirementsController
(
[
$validator
]
,
$jwtCertificateGenerator
, __DIR__
)
;
$controller
->
setContainer
(
$this
->
getInstallerContainer
(
$twig
)
)
;
$response
=
$controller
->
requirements
(
$request
)
;
static
::
assertSame
(
'checks',
$response
->
getContent
(
)
)
;
}
public
function
testRequirementsRouteRedirectsOnPostWhenChecksPass
(
)
: void
{
$request
=
new
Request
(
)
;
$request
->
setMethod
(
'POST'
)
;
$container
[
'controller.batch'
]
=
function
D
)
use
(
$me
)
{
return
new
BatchController
(
$me
->
get
(
'slim.request'
)
,
$me
->
get
(
'slim.response'
)
,
$me
)
;
}
;
$container
[
'controller.requirements'
]
=
function
D
)
use
(
$me
)
{
return
new
RequirementsController
(
$me
->
get
(
'slim.request'
)
,
$me
->
get
(
'slim.response'
)
,
$me
,
$me
->
get
(
'app'
)
)
;
}
;
$container
[
'controller.cleanup'
]
=
function
D
)
use
(
$me
,
$backupDir
)
{
return
new
CleanupController
(
$me
->
get
(
'slim.request'
)
,
$me
->
get
(
'slim.response'
)
,