use Symfony\Component\Stopwatch\StopwatchEvent;
class WrappedListenerTest extends TestCase
{ /**
* @dataProvider provideListenersToDescribe
*/
public function testListenerDescription($listener,
$expected) { $wrappedListener =
new WrappedListener($listener, null,
$this->
createMock(Stopwatch::
class),
$this->
createMock(EventDispatcherInterface::
class));
$this->
assertStringMatchesFormat($expected,
$wrappedListener->
getPretty());
} 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'
],
[