Skip to content

Commit cd590cd

Browse files
committed
chore: add test for service provider event registration
1 parent 7374691 commit cd590cd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/EventServiceProviderTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,21 @@ public function it_can_make_sure_some_aws_credentials_are_provided_and_valid(arr
128128
$this->assertArrayHasKey('foo', $config);
129129
$this->assertArrayNotHasKey('credentials', $config);
130130
}
131+
132+
/**
133+
* @test
134+
*/
135+
public function it_can_register_listeners_when_array_is_populated()
136+
{
137+
$this->app->register(TestPubSubEventServiceProvider::class);
138+
139+
$this->assertEquals(['bar'], Event::getRawListeners()['foo']);
140+
}
141+
}
142+
143+
class TestPubSubEventServiceProvider extends EventServiceProvider
144+
{
145+
protected $listen = [
146+
'foo' => ['bar'],
147+
];
131148
}

0 commit comments

Comments
 (0)