Definition at line 5 of file EventEmitterTest.php.
◆ testCancelEvent()
Sabre\Event\EventEmitterTest::testCancelEvent |
( |
| ) |
|
testHandleEvent
Definition at line 52 of file EventEmitterTest.php.
56 $ee =
new EventEmitter();
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);
◆ testHandleEvent()
Sabre\Event\EventEmitterTest::testHandleEvent |
( |
| ) |
|
testInit
Definition at line 30 of file EventEmitterTest.php.
34 $ee =
new EventEmitter();
35 $ee->on(
'foo',
function($arg) use (&$argResult) {
42 $ee->emit(
'foo', [
'bar'])
45 $this->assertEquals(
'bar', $argResult);
◆ testInit()
Sabre\Event\EventEmitterTest::testInit |
( |
| ) |
|
Definition at line 7 of file EventEmitterTest.php.
9 $ee =
new EventEmitter();
10 $this->assertInstanceOf(
'Sabre\\Event\\EventEmitter', $ee);
◆ testListeners()
Sabre\Event\EventEmitterTest::testListeners |
( |
| ) |
|
Definition at line 14 of file EventEmitterTest.php.
16 $ee =
new EventEmitter();
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'));
◆ testOnce()
Sabre\Event\EventEmitterTest::testOnce |
( |
| ) |
|
◆ testPriority()
Sabre\Event\EventEmitterTest::testPriority |
( |
| ) |
|
testCancelEvent
Definition at line 80 of file EventEmitterTest.php.
84 $ee =
new EventEmitter();
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);
◆ testPriority2()
Sabre\Event\EventEmitterTest::testPriority2 |
( |
| ) |
|
testPriority
Definition at line 109 of file EventEmitterTest.php.
References $result.
112 $ee =
new EventEmitter();
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);
◆ testPriorityOnce()
Sabre\Event\EventEmitterTest::testPriorityOnce |
( |
| ) |
|
testCancelEvent
Definition at line 293 of file EventEmitterTest.php.
297 $ee =
new EventEmitter();
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);
◆ testRemoveAllListeners()
Sabre\Event\EventEmitterTest::testRemoveAllListeners |
( |
| ) |
|
Definition at line 222 of file EventEmitterTest.php.
References $result.
225 $callBack =
function() use (&
$result) {
231 $ee =
new EventEmitter();
232 $ee->on(
'foo', $callBack);
238 $ee->removeAllListeners(
'foo');
◆ testRemoveAllListenersNoArg()
Sabre\Event\EventEmitterTest::testRemoveAllListenersNoArg |
( |
| ) |
|
Definition at line 245 of file EventEmitterTest.php.
References $result.
249 $callBack =
function() use (&
$result) {
256 $ee =
new EventEmitter();
257 $ee->on(
'foo', $callBack);
263 $ee->removeAllListeners();
◆ testRemoveListener()
Sabre\Event\EventEmitterTest::testRemoveListener |
( |
| ) |
|
Definition at line 140 of file EventEmitterTest.php.
References $result.
144 $callBack =
function() use (&
$result) {
150 $ee =
new EventEmitter();
152 $ee->on(
'foo', $callBack);
159 $ee->removeListener(
'foo', $callBack)
◆ testRemoveListenerTwice()
Sabre\Event\EventEmitterTest::testRemoveListenerTwice |
( |
| ) |
|
Definition at line 192 of file EventEmitterTest.php.
References $result.
196 $callBack =
function() use (&
$result) {
202 $ee =
new EventEmitter();
204 $ee->on(
'foo', $callBack);
211 $ee->removeListener(
'foo', $callBack)
214 $ee->removeListener(
'foo', $callBack)
◆ testRemoveUnknownListener()
Sabre\Event\EventEmitterTest::testRemoveUnknownListener |
( |
| ) |
|
Definition at line 167 of file EventEmitterTest.php.
References $result.
171 $callBack =
function() use (&
$result) {
177 $ee =
new EventEmitter();
179 $ee->on(
'foo', $callBack);
185 $this->assertFalse($ee->removeListener(
'bar', $callBack));
The documentation for this class was generated from the following file: