use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Mailer\Event\MessageEvent;
class EventDispatcherDebugCommandTest extends TestCase
{ /**
* @dataProvider provideCompletionSuggestions
*/
public function testComplete(array
$input, array
$expectedSuggestions) { $tester =
$this->
createCommandCompletionTester();
$suggestions =
$tester->
complete($input);
$this->
assertSame($expectedSuggestions,
$suggestions);
} public static function provideCompletionSuggestions() { yield 'event' =>
[[''
],
[MessageEvent::
class, 'console.command'
]];
yield 'event for other dispatcher' =>
[['--dispatcher', 'other_event_dispatcher', ''
],
['other_event', 'App\OtherEvent'
]];
yield 'dispatcher' =>
[['--dispatcher='
],
['event_dispatcher', 'other_event_dispatcher'
]];