9
9
use Kreait \Firebase \Exception \InvalidArgumentException ;
10
10
use Kreait \Firebase \Factory ;
11
11
use Kreait \Laravel \Firebase \FirebaseProjectManager ;
12
+ use PHPUnit \Framework \Attributes \Test ;
12
13
use Psr \Cache \CacheItemPoolInterface ;
13
14
use ReflectionObject ;
14
15
@@ -22,9 +23,7 @@ protected function defineEnvironment($app): void
22
23
$ app ['config ' ]->set ('firebase.projects.app.credentials ' , __DIR__ .'/_fixtures/service_account.json ' );
23
24
}
24
25
25
- /**
26
- * @test
27
- */
26
+ #[Test]
28
27
public function a_project_configuration_has_to_exist (): void
29
28
{
30
29
$ manager = $ this ->app ->make (FirebaseProjectManager::class);
@@ -36,9 +35,7 @@ public function a_project_configuration_has_to_exist(): void
36
35
$ this ->getAccessibleMethod ($ manager , 'configuration ' )->invoke ($ manager , $ projectName );
37
36
}
38
37
39
- /**
40
- * @test
41
- */
38
+ #[Test]
42
39
public function a_default_project_can_be_set (): void
43
40
{
44
41
$ manager = $ this ->app ->make (FirebaseProjectManager::class);
@@ -51,9 +48,7 @@ public function a_default_project_can_be_set(): void
51
48
$ this ->assertSame ($ projectName , $ this ->app ->config ->get ('firebase.default ' ), 'default project should be set in config ' );
52
49
}
53
50
54
- /**
55
- * @test
56
- */
51
+ #[Test]
57
52
public function calls_are_passed_to_default_project (): void
58
53
{
59
54
$ manager = $ this ->app ->make (FirebaseProjectManager::class);
@@ -63,9 +58,7 @@ public function calls_are_passed_to_default_project(): void
63
58
$ this ->assertSame ($ manager ->project ($ projectName )->auth (), $ manager ->auth ());
64
59
}
65
60
66
- /**
67
- * @test
68
- */
61
+ #[Test]
69
62
public function credentials_can_be_configured_using_a_json_file (): void
70
63
{
71
64
// Reference credentials
@@ -84,9 +77,7 @@ public function credentials_can_be_configured_using_a_json_file(): void
84
77
$ this ->assertSame ($ credentials , $ serviceAccount );
85
78
}
86
79
87
- /**
88
- * @test
89
- */
80
+ #[Test]
90
81
public function json_file_credentials_can_be_used_using_the_deprecated_configuration_entry (): void
91
82
{
92
83
// Reference credentials
@@ -105,9 +96,7 @@ public function json_file_credentials_can_be_used_using_the_deprecated_configura
105
96
$ this ->assertSame ($ credentials , $ serviceAccount );
106
97
}
107
98
108
- /**
109
- * @test
110
- */
99
+ #[Test]
111
100
public function credentials_can_be_configured_using_an_array (): void
112
101
{
113
102
// Set configuration and retrieve project
@@ -133,9 +122,7 @@ public function credentials_can_be_configured_using_an_array(): void
133
122
$ this ->assertSame ($ credentials , $ serviceAccount );
134
123
}
135
124
136
- /**
137
- * @test
138
- */
125
+ #[Test]
139
126
public function projects_can_have_different_credentials (): void
140
127
{
141
128
// Reference credentials
@@ -165,9 +152,7 @@ public function projects_can_have_different_credentials(): void
165
152
$ this ->assertSame ($ secondCredentials , $ secondServiceAccount );
166
153
}
167
154
168
- /**
169
- * @test
170
- */
155
+ #[Test]
171
156
public function the_realtime_database_url_can_be_configured (): void
172
157
{
173
158
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -181,9 +166,7 @@ public function the_realtime_database_url_can_be_configured(): void
181
166
$ this ->assertSame ($ url , (string ) $ property ->getValue ($ database ));
182
167
}
183
168
184
- /**
185
- * @test
186
- */
169
+ #[Test]
187
170
public function the_dynamic_links_default_domain_can_be_configured (): void
188
171
{
189
172
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -198,9 +181,7 @@ public function the_dynamic_links_default_domain_can_be_configured(): void
198
181
$ this ->assertSame ($ domain , $ configuredDomain );
199
182
}
200
183
201
- /**
202
- * @test
203
- */
184
+ #[Test]
204
185
public function the_storage_default_bucket_can_be_configured (): void
205
186
{
206
187
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -213,9 +194,7 @@ public function the_storage_default_bucket_can_be_configured(): void
213
194
$ this ->assertSame ($ name , $ property ->getValue ($ storage ));
214
195
}
215
196
216
- /**
217
- * @test
218
- */
197
+ #[Test]
219
198
public function logging_can_be_configured (): void
220
199
{
221
200
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -228,9 +207,7 @@ public function logging_can_be_configured(): void
228
207
$ this ->assertNotNull ($ property ->getValue ($ factory ));
229
208
}
230
209
231
- /**
232
- * @test
233
- */
210
+ #[Test]
234
211
public function debug_logging_can_be_configured (): void
235
212
{
236
213
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -243,9 +220,7 @@ public function debug_logging_can_be_configured(): void
243
220
$ this ->assertNotNull ($ property ->getValue ($ factory ));
244
221
}
245
222
246
- /**
247
- * @test
248
- */
223
+ #[Test]
249
224
public function http_client_options_can_be_configured (): void
250
225
{
251
226
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -263,9 +238,7 @@ public function http_client_options_can_be_configured(): void
263
238
$ this ->assertSame ([RetryMiddleware::class], $ httpClientOptions ->guzzleMiddlewares ());
264
239
}
265
240
266
- /**
267
- * @test
268
- */
241
+ #[Test]
269
242
public function it_uses_the_laravel_cache_as_verifier_cache (): void
270
243
{
271
244
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
@@ -276,9 +249,7 @@ public function it_uses_the_laravel_cache_as_verifier_cache(): void
276
249
$ this ->assertInstanceOf (CacheItemPoolInterface::class, $ property ->getValue ($ factory ));
277
250
}
278
251
279
- /**
280
- * @test
281
- */
252
+ #[Test]
282
253
public function it_overrides_the_default_firestore_database (): void
283
254
{
284
255
config (['firebase.projects.app.firestore.database ' => 'override-database ' ]);
@@ -290,9 +261,7 @@ public function it_overrides_the_default_firestore_database(): void
290
261
$ this ->assertEquals ('override-database ' , $ property ->getValue ($ factory )['database ' ]);
291
262
}
292
263
293
- /**
294
- * @test
295
- */
264
+ #[Test]
296
265
public function it_uses_the_laravel_cache_as_auth_token_cache (): void
297
266
{
298
267
$ projectName = $ this ->app ->config ->get ('firebase.default ' );
0 commit comments