33namespace PodPoint \AwsPubSub \Tests ;
44
55use Illuminate \Support \Facades \Event ;
6+ use PHPUnit \Framework \Attributes \DataProvider ;
7+ use PHPUnit \Framework \Attributes \Test ;
68use PodPoint \AwsPubSub \EventServiceProvider ;
79
810class EventServiceProviderTest extends TestCase
911{
12+ #[Test]
1013 /** @test */
1114 public function it_can_prepare_configuration_credentials ()
1215 {
@@ -27,6 +30,7 @@ public function it_can_prepare_configuration_credentials()
2730 ], $ config );
2831 }
2932
33+ #[Test]
3034 /** @test */
3135 public function it_can_prepare_configuration_credentials_with_a_token ()
3236 {
@@ -50,6 +54,7 @@ public function it_can_prepare_configuration_credentials_with_a_token()
5054 ], $ config );
5155 }
5256
57+ #[Test]
5358 /** @test */
5459 public function it_can_make_sure_some_aws_credentials_are_provided_before_preparing_the_credentials ()
5560 {
@@ -61,65 +66,64 @@ public function it_can_make_sure_some_aws_credentials_are_provided_before_prepar
6166 $ this ->assertArrayNotHasKey ('credentials ' , $ config );
6267 }
6368
64- public function invalidCredentialsDataProvider ()
69+ public static function invalidCredentialsDataProvider ()
6570 {
6671 return [
6772 'key_is_empty ' => [
68- ' creds ' => [
73+ [
6974 'key ' => '' ,
7075 'secret ' => 'some_secret ' ,
7176 ],
7277 ],
7378 'secret_is_empty ' => [
74- ' creds ' => [
79+ [
7580 'key ' => 'some_key ' ,
7681 'secret ' => '' ,
7782 ],
7883 ],
7984 'key_and_secret_are_empty ' => [
80- ' creds ' => [
85+ [
8186 'key ' => '' ,
8287 'secret ' => '' ,
8388 ],
8489 ],
8590 'key_is_null ' => [
86- ' creds ' => [
91+ [
8792 'key ' => null ,
8893 'secret ' => 'some_secret ' ,
8994 ],
9095 ],
9196 'secret_is_null ' => [
92- ' creds ' => [
97+ [
9398 'key ' => 'some_key ' ,
9499 'secret ' => null ,
95100 ],
96101 ],
97102 'key_and_secret_are_null ' => [
98- ' creds ' => [
103+ [
99104 'key ' => null ,
100105 'secret ' => null ,
101106 ],
102107 ],
103108 'key_is_empty_and_secret_is_null ' => [
104- ' creds ' => [
109+ [
105110 'key ' => '' ,
106111 'secret ' => null ,
107112 ],
108113 ],
109114 'key_is_null_and_secret_is_empty ' => [
110- ' creds ' => [
115+ [
111116 'key ' => null ,
112117 'secret ' => '' ,
113118 ],
114119 ],
115120 ];
116121 }
117122
118- /**
119- * @test
120- *
121- * @dataProvider invalidCredentialsDataProvider
122- */
123+ #[Test]
124+ /** @test */
125+ #[DataProvider('invalidCredentialsDataProvider ' )]
126+ /** @dataProvider invalidCredentialsDataProvider */
123127 public function it_can_make_sure_some_aws_credentials_are_provided_and_valid (array $ invalidCredentials )
124128 {
125129 $ config = EventServiceProvider::prepareConfigurationCredentials (array_merge ([
@@ -130,9 +134,8 @@ public function it_can_make_sure_some_aws_credentials_are_provided_and_valid(arr
130134 $ this ->assertArrayNotHasKey ('credentials ' , $ config );
131135 }
132136
133- /**
134- * @test
135- */
137+ #[Test]
138+ /** @test */
136139 public function it_can_register_listeners_when_listen_array_is_populated ()
137140 {
138141 $ this ->app ->register (TestPubSubEventServiceProvider::class);
0 commit comments