We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb9a897 commit 9ecb146Copy full SHA for 9ecb146
tests/Support/SupportTestingEventFakeTest.php
@@ -46,6 +46,20 @@ public function testAssertDispatchedWithClosure()
46
});
47
}
48
49
+ public function testAssertListening()
50
+ {
51
+ $listener = ListenerStub::class;
52
+
53
+ $dispatcher = m::mock(Dispatcher::class);
54
+ $dispatcher->shouldReceive('getListeners')->andReturn([function ($event, $payload) use ($listener) {
55
+ return $listener(...array_values($payload));
56
+ }]);
57
58
+ $fake = new EventFake($dispatcher);
59
60
+ $fake->assertListening(EventStub::class, ListenerStub::class);
61
+ }
62
63
public function testAssertDispatchedWithCallbackInt()
64
{
65
$this->fake->dispatch(EventStub::class);
@@ -145,3 +159,8 @@ class EventStub
145
159
146
160
//
147
161
162
163
+class ListenerStub
164
+{
165
+ //
166
+}
0 commit comments