Skip to content

Commit 50e9aa9

Browse files
committed
strengthen the test that listeners can be set before and after pushed event
1 parent 12b492b commit 50e9aa9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/Events/EventsDispatcherTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,17 @@ public function testQueuedEventsAreFired()
132132
{
133133
unset($_SERVER['__event.test']);
134134
$d = new Dispatcher;
135-
$d->push('update', ['name' => 'taylor']);
136135
$d->listen('update', function ($name) {
137136
$_SERVER['__event.test'] = $name;
138137
});
138+
$d->push('update', ['name' => 'taylor']);
139+
$d->listen('update', function ($name) {
140+
$_SERVER['__event.test'] .= $name;
141+
});
139142

140143
$this->assertFalse(isset($_SERVER['__event.test']));
141144
$d->flush('update');
142-
$this->assertSame('taylor', $_SERVER['__event.test']);
145+
$this->assertSame('taylortaylor', $_SERVER['__event.test']);
143146
}
144147

145148
public function testQueuedEventsCanBeForgotten()

0 commit comments

Comments
 (0)