@@ -22,7 +22,7 @@ class GoFeatureFlagProviderTest extends TestCase
2222{
2323 private EvaluationContext $ defaultEvaluationContext ;
2424
25- public function test_should_throw_if_invalid_endpoint ()
25+ public function test_should_throw_if_invalid_endpoint (): void
2626 {
2727 $ this ->expectException (InvalidConfigException::class);
2828 new GoFeatureFlagProvider (
@@ -32,15 +32,15 @@ public function test_should_throw_if_invalid_endpoint()
3232
3333 // Configuration validation tests
3434
35- public function test_should_not_throw_if_valid_endpoint ()
35+ public function test_should_not_throw_if_valid_endpoint (): void
3636 {
3737 $ provider = new GoFeatureFlagProvider (
3838 new Config ('https://gofeatureflag.org ' )
3939 );
4040 $ this ->assertInstanceOf (GoFeatureFlagProvider::class, $ provider );
4141 }
4242
43- public function test_should_raise_if_endpoint_is_not_http ()
43+ public function test_should_raise_if_endpoint_is_not_http (): void
4444 {
4545 $ this ->expectException (InvalidConfigException::class);
4646 $ provider = new GoFeatureFlagProvider (
@@ -49,15 +49,15 @@ public function test_should_raise_if_endpoint_is_not_http()
4949 $ this ->assertInstanceOf (GoFeatureFlagProvider::class, $ provider );
5050 }
5151
52- public function test_empty_endpoint_should_throw ()
52+ public function test_empty_endpoint_should_throw (): void
5353 {
5454 $ this ->expectException (InvalidConfigException::class);
5555 new GoFeatureFlagProvider (
5656 new Config ('' )
5757 );
5858 }
5959
60- public function test_metadata_name_is_defined ()
60+ public function test_metadata_name_is_defined (): void
6161 {
6262 $ config = new Config ('http://localhost:1031 ' );
6363 $ provider = new GoFeatureFlagProvider ($ config );
@@ -68,7 +68,7 @@ public function test_metadata_name_is_defined()
6868
6969 // Metadata tests
7070
71- public function test_should_return_the_value_of_the_flag_as_int ()
71+ public function test_should_return_the_value_of_the_flag_as_int (): void
7272 {
7373 $ mockClient = $ this ->createMock (Client::class);
7474 $ mockResponse = new Response (200 , [], json_encode ([
@@ -98,7 +98,7 @@ public function test_should_return_the_value_of_the_flag_as_int()
9898 assertEquals ('integer_key ' , $ got ->getFlagKey ());
9999 }
100100
101- private function mockHttpClient ($ provider , $ mockClient )
101+ private function mockHttpClient ($ provider , $ mockClient ): void
102102 {
103103 $ providerReflection = new \ReflectionClass ($ provider );
104104 $ ofrepApiProperty = $ providerReflection ->getProperty ('ofrepApi ' );
@@ -111,7 +111,7 @@ private function mockHttpClient($provider, $mockClient)
111111 $ clientProperty ->setValue ($ ofrepApi , $ mockClient );
112112 }
113113
114- public function test_should_return_the_value_of_the_flag_as_float ()
114+ public function test_should_return_the_value_of_the_flag_as_float (): void
115115 {
116116 $ mockClient = $ this ->createMock (Client::class);
117117 $ mockResponse = new Response (200 , [], json_encode ([
@@ -141,7 +141,7 @@ public function test_should_return_the_value_of_the_flag_as_float()
141141 assertEquals ('flag-key ' , $ got ->getFlagKey ());
142142 }
143143
144- public function test_should_return_the_value_of_the_flag_as_string ()
144+ public function test_should_return_the_value_of_the_flag_as_string (): void
145145 {
146146 $ mockClient = $ this ->createMock (Client::class);
147147 $ mockResponse = new Response (200 , [], json_encode ([
@@ -171,7 +171,7 @@ public function test_should_return_the_value_of_the_flag_as_string()
171171 assertEquals ('flag-key ' , $ got ->getFlagKey ());
172172 }
173173
174- public function test_should_return_the_value_of_the_flag_as_bool ()
174+ public function test_should_return_the_value_of_the_flag_as_bool (): void
175175 {
176176 $ mockClient = $ this ->createMock (Client::class);
177177 $ mockResponse = new Response (200 , [], json_encode ([
@@ -201,7 +201,7 @@ public function test_should_return_the_value_of_the_flag_as_bool()
201201 assertEquals ('flag-key ' , $ got ->getFlagKey ());
202202 }
203203
204- public function test_should_return_the_value_of_the_flag_as_object ()
204+ public function test_should_return_the_value_of_the_flag_as_object (): void
205205 {
206206 $ mockClient = $ this ->createMock (Client::class);
207207 $ mockResponse = new Response (200 , [], json_encode ([
@@ -231,7 +231,7 @@ public function test_should_return_the_value_of_the_flag_as_object()
231231 assertEquals ('flag-key ' , $ got ->getFlagKey ());
232232 }
233233
234- public function test_should_return_the_default_value_if_flag_is_not_the_right_type ()
234+ public function test_should_return_the_default_value_if_flag_is_not_the_right_type (): void
235235 {
236236 $ mockClient = $ this ->createMock (Client::class);
237237 $ mockResponse = new Response (200 , [], json_encode ([
@@ -262,7 +262,7 @@ public function test_should_return_the_default_value_if_flag_is_not_the_right_ty
262262 assertEquals ('integer_key ' , $ got ->getFlagKey ());
263263 }
264264
265- public function test_should_return_the_default_value_of_the_flag_if_error_send_by_the_API_http_code_403 ()
265+ public function test_should_return_the_default_value_of_the_flag_if_error_send_by_the_API_http_code_403 (): void
266266 {
267267 $ mockClient = $ this ->createMock (Client::class);
268268 $ mockResponse = new Response (403 , [], json_encode ([]));
@@ -288,7 +288,7 @@ public function test_should_return_the_default_value_of_the_flag_if_error_send_b
288288 assertEquals ('boolean_key ' , $ got ->getFlagKey ());
289289 }
290290
291- public function test_should_return_the_default_value_of_the_flag_if_error_send_by_the_API__http_code_400__ ()
291+ public function test_should_return_the_default_value_of_the_flag_if_error_send_by_the_API__http_code_400 (): void
292292 {
293293 $ mockClient = $ this ->createMock (Client::class);
294294 $ mockResponse = new Response (400 , [], json_encode ([
@@ -319,7 +319,7 @@ public function test_should_return_the_default_value_of_the_flag_if_error_send_b
319319 assertEquals ('boolean_key ' , $ got ->getFlagKey ());
320320 }
321321
322- public function test_should_return_default_value_if_no_evaluation_context ()
322+ public function test_should_return_default_value_if_no_evaluation_context (): void
323323 {
324324 $ mockClient = $ this ->createMock (Client::class);
325325 $ mockResponse = new Response (200 , [], json_encode ([
@@ -349,7 +349,7 @@ public function test_should_return_default_value_if_no_evaluation_context()
349349 assertEquals ('boolean_key ' , $ got ->getFlagKey ());
350350 }
351351
352- public function test_should_return_default_value_if_evaluation_context_has_empty_string_targetingKey ()
352+ public function test_should_return_default_value_if_evaluation_context_has_empty_string_targetingKey (): void
353353 {
354354 $ mockClient = $ this ->createMock (Client::class);
355355 $ mockResponse = new Response (200 , [], json_encode ([
@@ -379,7 +379,7 @@ public function test_should_return_default_value_if_evaluation_context_has_empty
379379 assertEquals ('boolean_key ' , $ got ->getFlagKey ());
380380 }
381381
382- public function test_should_return_default_value_if_evaluation_context_has_null_targetingKey ()
382+ public function test_should_return_default_value_if_evaluation_context_has_null_targetingKey (): void
383383 {
384384 $ mockClient = $ this ->createMock (Client::class);
385385 $ mockResponse = new Response (200 , [], json_encode ([
@@ -409,7 +409,7 @@ public function test_should_return_default_value_if_evaluation_context_has_null_
409409 assertEquals ('boolean_key ' , $ got ->getFlagKey ());
410410 }
411411
412- public function test_should_return_default_value_if_flag_key_empty_string ()
412+ public function test_should_return_default_value_if_flag_key_empty_string (): void
413413 {
414414 $ mockClient = $ this ->createMock (Client::class);
415415 $ mockResponse = new Response (200 , [], json_encode ([
@@ -439,7 +439,7 @@ public function test_should_return_default_value_if_flag_key_empty_string()
439439 assertEquals ('' , $ got ->getFlagKey ());
440440 }
441441
442- public function test_return_an_error_API_response_if_500 ()
442+ public function test_return_an_error_API_response_if_500 (): void
443443 {
444444 $ mockClient = $ this ->createMock (Client::class);
445445 $ mockResponse = new Response (500 , [], json_encode ([]));
@@ -472,7 +472,7 @@ protected function setUp(): void
472472 $ this ->
defaultEvaluationContext =
new MutableEvaluationContext (
"214b796a-807b-4697-b3a3-42de0ec10a37 " ,
new Attributes ([
"email " =>
"[email protected] " ]));
473473 }
474474
475- private function mockClient ($ provider , $ mockClient )
475+ private function mockClient ($ provider , $ mockClient ): void
476476 {
477477 $ providerReflection = new \ReflectionClass ($ provider );
478478 $ ofrepApiProperty = $ providerReflection ->getProperty ('ofrepApi ' );
0 commit comments