Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SignableCommand example
$app
->
setCommandLoader
(
$loader
)
;
$app
->
get
(
'test'
)
;
}
/** * @requires extension pcntl */
public
function
testSignalListenerNotCalledByDefault
(
)
{
$command
=
new
SignableCommand
(
false
)
;
$dispatcherCalled
= false;
$dispatcher
=
new
EventDispatcher
(
)
;
$dispatcher
->
addListener
(
'console.signal',
function
D
)
use
(
&
$dispatcherCalled
)
{
$dispatcherCalled
= true;
}
)
;
$application
=
$this
->
createSignalableApplication
(
$command
,
$dispatcher
)
;
$this
->
assertSame
(
0,
$application
->
run
(
new
ArrayInput
(
[
'signal'
]
)
)
)
;
$this
->
assertFalse
(
$command
->signaled
)
;