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'
],
[\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'],
];
}