Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FooWithoutAliasCommand example
$application
=
new
Application
(
)
;
$application
->
add
(
new
\
Foo1Command
(
)
)
;
$application
->
setAutoExit
(
false
)
;
$tester
=
new
ApplicationTester
(
$application
)
;
$tester
->
run
(
[
'command' => 'foos:bar1'
]
,
[
'decorated' => false
]
)
;
$this
->
assertStringEqualsFile
(
self::
$fixturesPath
.'/application.dont_run_alternative_namespace_name.txt',
$tester
->
getDisplay
(
true
)
)
;
}
public
function
testCanRunAlternativeCommandName
(
)
{
$application
=
new
Application
(
)
;
$application
->
add
(
new
\
FooWithoutAliasCommand
(
)
)
;
$application
->
setAutoExit
(
false
)
;
$tester
=
new
ApplicationTester
(
$application
)
;
$tester
->
setInputs
(
[
'y'
]
)
;
$tester
->
run
(
[
'command' => 'foos'
]
,
[
'decorated' => false
]
)
;
$display
=
trim
(
$tester
->
getDisplay
(
true
)
)
;
$this
->
assertStringContainsString
(
'Command "foos" is not defined',
$display
)
;
$this
->
assertStringContainsString
(
'Do you want to run "foo" instead? (yes/no) [no]:',
$display
)
;
$this
->
assertStringContainsString
(
'called',
$display
)
;
}
public
function
testDontRunAlternativeCommandName
(
)
{