10 $this->assertInstanceOf(
'Sabre\\Event\\EventEmitter', $ee);
18 $callback1 =
function() { };
19 $callback2 =
function() { };
20 $ee->on(
'foo', $callback1, 200);
21 $ee->on(
'foo', $callback2, 100);
23 $this->assertEquals([$callback2, $callback1], $ee->listeners(
'foo'));
35 $ee->on(
'foo',
function($arg) use (&$argResult) {
42 $ee->emit(
'foo', [
'bar'])
45 $this->assertEquals(
'bar', $argResult);
57 $ee->on(
'foo',
function($arg) use (&$argResult) {
63 $ee->on(
'foo',
function($arg) use (&$argResult) {
70 $ee->emit(
'foo', [
'bar'])
73 $this->assertEquals(1, $argResult);
85 $ee->on(
'foo',
function($arg) use (&$argResult) {
91 $ee->on(
'foo',
function($arg) use (&$argResult) {
99 $ee->emit(
'foo', [
'bar'])
102 $this->assertEquals(2, $argResult);
114 $ee->on(
'foo',
function() use (&
$result) {
119 $ee->on(
'foo',
function() use (&
$result) {
124 $ee->on(
'foo',
function() use (&
$result) {
129 $ee->on(
'foo',
function() use (&
$result) {
136 $this->assertEquals([
'b',
'd',
'a',
'c'],
$result);
144 $callBack =
function() use (&
$result) {
152 $ee->on(
'foo', $callBack);
159 $ee->removeListener(
'foo', $callBack)
171 $callBack =
function() use (&
$result) {
179 $ee->on(
'foo', $callBack);
185 $this->assertFalse($ee->removeListener(
'bar', $callBack));
196 $callBack =
function() use (&
$result) {
204 $ee->on(
'foo', $callBack);
211 $ee->removeListener(
'foo', $callBack)
214 $ee->removeListener(
'foo', $callBack)
225 $callBack =
function() use (&
$result) {
232 $ee->on(
'foo', $callBack);
238 $ee->removeAllListeners(
'foo');
249 $callBack =
function() use (&
$result) {
257 $ee->on(
'foo', $callBack);
263 $ee->removeAllListeners();
274 $callBack =
function() use (&
$result) {
281 $ee->once(
'foo', $callBack);
286 $this->assertEquals(1,
$result);
298 $ee->once(
'foo',
function($arg) use (&$argResult) {
304 $ee->once(
'foo',
function($arg) use (&$argResult) {
312 $ee->emit(
'foo', [
'bar'])
315 $this->assertEquals(2, $argResult);
testRemoveUnknownListener()
testPriority2()
testPriority
testCancelEvent()
testHandleEvent
testHandleEvent()
testInit
testRemoveAllListenersNoArg()
testPriority()
testCancelEvent
testPriorityOnce()
testCancelEvent
testRemoveListenerTwice()