Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
InstallController example
class
InstallControllerTest
extends
TestCase
{
public
function
testStartPage
(
)
: void
{
$recovery
=
$this
->
createMock
(
RecoveryManager::
class
)
;
$recovery
->
method
(
'getShopwareLocation'
)
->
willReturn
(
'asd'
)
;
$responseGenerator
=
$this
->
createMock
(
StreamedCommandResponseGenerator::
class
)
;
$responseGenerator
->
method
(
'runJSON'
)
->
willReturn
(
new
StreamedResponse
(
)
)
;
$controller
=
new
InstallController
(
$recovery
,
$responseGenerator
,
$this
->
createMock
(
ReleaseInfoProvider::
class
)
)
;
$controller
->
setContainer
(
$this
->
getContainer
(
)
)
;
$response
=
$controller
->
index
(
)
;
static
::
assertSame
(
Response::HTTP_OK,
$response
->
getStatusCode
(
)
)
;
static
::
assertSame
(
'install.html.twig',
$response
->
getContent
(
)
)
;
}
public
function
testInstall
(
)
: void
{
$tmpDir
=
sys_get_temp_dir
(
)
. '/' .
uniqid
(
'test', true
)
;