33namespace Illuminated \Helpers \Tests \array ;
44
55use Illuminated \Helpers \Tests \TestCase ;
6+ use PHPUnit \Framework \Attributes \Test ;
67
78class ArrayExceptValueTest extends TestCase
89{
9- /** @test */
10- public function it_returns_array_itself_after_excluding_not_existing_value ()
10+ #[Test]
11+ public function it_returns_array_itself_after_excluding_not_existing_value (): void
1112 {
1213 $ this ->assertEquals ([], array_except_value ([], null ));
1314 $ this ->assertEquals ([], array_except_value ([], 'foo ' ));
1415 $ this ->assertEquals (['foo ' , 'bar ' , 'baz ' ], array_except_value (['foo ' , 'bar ' , 'baz ' ], 'bax ' ));
1516 }
1617
17- /** @test */
18- public function it_preserves_keys_after_excluding_value ()
18+ #[Test]
19+ public function it_preserves_keys_after_excluding_value (): void
1920 {
2021 $ this ->assertEquals (
2122 [0 => 'foo ' , 2 => 'baz ' ],
2223 array_except_value (['foo ' , 'bar ' , 'baz ' ], 'bar ' )
2324 );
2425 }
2526
26- /** @test */
27- public function it_excludes_all_occurrences_of_the_value ()
27+ #[Test]
28+ public function it_excludes_all_occurrences_of_the_value (): void
2829 {
2930 $ this ->assertEquals (
3031 [0 => 'foo ' , 4 => 'bar ' ],
3132 array_except_value (['foo ' , 'baz ' , 'baz ' , 'baz ' , 'bar ' ], 'baz ' )
3233 );
3334 }
3435
35- /** @test */
36- public function it_can_exclude_null_value ()
36+ #[Test]
37+ public function it_can_exclude_null_value (): void
3738 {
3839 $ this ->assertEquals (['foo ' , 'bar ' , 'baz ' ], array_except_value (['foo ' , 'bar ' , 'baz ' , null ], null ));
3940 }
4041
41- /** @test */
42- public function it_can_exclude_boolean_true_value ()
42+ #[Test]
43+ public function it_can_exclude_boolean_true_value (): void
4344 {
4445 $ this ->assertEquals (['foo ' , 'bar ' , 'baz ' ], array_except_value (['foo ' , 'bar ' , 'baz ' , true , true ], true ));
4546 }
4647
47- /** @test */
48- public function it_can_exclude_boolean_false_value ()
48+ #[Test]
49+ public function it_can_exclude_boolean_false_value (): void
4950 {
5051 $ this ->assertEquals (
5152 ['foo ' , 'bar ' , 'baz ' , 5 => null ],
5253 array_except_value (['foo ' , 'bar ' , 'baz ' , false , false , null ], false )
5354 );
5455 }
5556
56- /** @test */
57- public function it_can_exclude_integer_value ()
57+ #[Test]
58+ public function it_can_exclude_integer_value (): void
5859 {
5960 $ this ->assertEquals (
6061 [0 => 23 , 2 => 14 , 3 => 11 ],
6162 array_except_value ([23 , 17 , 14 , 11 ], 17 )
6263 );
6364 }
6465
65- /** @test */
66- public function it_can_exclude_float_value ()
66+ #[Test]
67+ public function it_can_exclude_float_value (): void
6768 {
6869 $ this ->assertEquals (
6970 [0 => 23.3 , 1 => 17.2 , 3 => 11.1 ],
7071 array_except_value ([23.3 , 17.2 , 14.5 , 11.1 ], 14.5 )
7172 );
7273 }
7374
74- /** @test */
75- public function it_can_exclude_string_value ()
75+ #[Test]
76+ public function it_can_exclude_string_value (): void
7677 {
7778 $ this ->assertEquals (['foo ' , 'bar ' ], array_except_value (['foo ' , 'bar ' , 'baz ' ], 'baz ' ));
7879 }
7980
80- /** @test */
81- public function it_can_exclude_multiple_different_values ()
81+ #[Test]
82+ public function it_can_exclude_multiple_different_values (): void
8283 {
8384 $ array = ['foo ' , 'bar ' , 'baz ' , 'bax ' ];
8485 $ this ->assertEquals ([1 => 'bar ' , 2 => 'baz ' ], array_except_value ($ array , ['foo ' , 'bax ' ]));
8586 }
8687
87- /** @test */
88- public function it_works_with_associative_array_and_single_value ()
88+ #[Test]
89+ public function it_works_with_associative_array_and_single_value (): void
8990 {
9091 $ array = [
9192 'foo ' => 'bar ' ,
@@ -95,8 +96,8 @@ public function it_works_with_associative_array_and_single_value()
9596 $ this ->assertEquals (['foo ' => 'bar ' , 'foz ' => 'faz ' ], array_except_value ($ array , 'bax ' ));
9697 }
9798
98- /** @test */
99- public function it_works_with_associative_array_and_multiple_values ()
99+ #[Test]
100+ public function it_works_with_associative_array_and_multiple_values (): void
100101 {
101102 $ array = [
102103 'foo ' => 'bar ' ,
0 commit comments