$this->
assertCount(0,
$dispatcher->
getListeners('foo'
));
} public function testGetCalledListeners() { $tdispatcher =
new TraceableEventDispatcher(new EventDispatcher(),
new Stopwatch());
$tdispatcher->
addListener('foo',
function D
) {}, 5
);
$listeners =
$tdispatcher->
getNotCalledListeners();
$this->
assertArrayHasKey('stub',
$listeners[0
]);
unset($listeners[0
]['stub'
]);
$this->
assertEquals([],
$tdispatcher->
getCalledListeners());
$this->
assertEquals([['event' => 'foo', 'pretty' => 'closure', 'priority' => 5
]],
$listeners);
$tdispatcher->
dispatch(new Event(), 'foo'
);
$listeners =
$tdispatcher->
getCalledListeners();
$this->
assertArrayHasKey('stub',
$listeners[0
]);
unset($listeners[0
]['stub'
]);
$this->
assertEquals([['event' => 'foo', 'pretty' => 'closure', 'priority' => 5
]],
$listeners);
$this->
assertEquals([],
$tdispatcher->
getNotCalledListeners());
}