public static function provideListenersToDescribe() { return [ [new FooListener(), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::__invoke'
],
[[new FooListener(), 'listen'
], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'
],
[['Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'
], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'
],
[['Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'invalidMethod'
], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::invalidMethod'
],
['var_dump', 'var_dump'
],
[function D
) {}, 'closure'
],
[\Closure::
fromCallable([new FooListener(), 'listen'
]), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'
],
[\Closure::
fromCallable(['Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'
]), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'
],
[\Closure::
fromCallable(function D
) {}), 'closure'
],
[[#[\Closure(name: FooListener::class)] static fn () => new FooListener(), 'listen'], 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'],
];
} public function testStopwatchEventIsStoppedWhenListenerThrows() { $stopwatchEvent =
$this->
createMock(StopwatchEvent::
class);
$stopwatchEvent->
expects(self::
once())->
method('isStarted'
)->
willReturn(true
);
$stopwatchEvent->
expects(self::
once())->
method('stop'
);