Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MigrationCommand example
$loader
->
expects
(
static
::
once
(
)
)
->
method
(
'collect'
)
->
willReturn
(
new
MigrationCollection
(
new
MigrationSource
(
''
)
,
new
MigrationRuntime
(
$connection
,
new
NullLogger
(
)
)
,
$connection
)
)
;
$cache
=
$this
->
getMockBuilder
(
TagAwareAdapter::
class
)
->
disableOriginalConstructor
(
)
->
getMock
(
)
;
$cache
->
expects
(
static
::
never
(
)
)
->
method
(
'clear'
)
;
$command
=
new
MigrationCommand
(
$loader
,
$cache
,
$this
->
getContainer
(
)
->
getParameter
(
'kernel.shopware_version'
)
)
;
$command
->
run
(
new
ArrayInput
(
[
'--all' => true, 'identifier' =>
[
self::
INTEGRATION_IDENTIFIER
(
)
]
]
)
,
new
BufferedOutput
(
)
)
;
static
::
assertSame
(
0,
$this
->
getMigrationCount
(
true
)
)
;
}
public
function
testCommandMigrateCacheClearBehaviourWithOneMigration
(
)
: void
{
static
::
assertSame
(
0,
$this
->
getMigrationCount
(
true
)
)
;
$cache
=
$this
->
getMockBuilder
(
TagAwareAdapter::
class
)
->
disableOriginalConstructor
(
)
->
getMock
(
)
;