|
4 | 4 |
|
5 | 5 | namespace PHPForge\Support\Tests\Support\Provider; |
6 | 6 |
|
7 | | -use PHPForge\Support\Tests\Stub\TestEnum; |
| 7 | +use PHPForge\Support\Stub\{BackedInteger, BackedString, Unit}; |
| 8 | +use UnitEnum; |
8 | 9 |
|
9 | 10 | /** |
10 | 11 | * Data provider for {@see \PHPForge\Support\Tests\EnumDataProviderTest} test cases. |
|
17 | 18 | final class EnumDataProviderProvider |
18 | 19 | { |
19 | 20 | /** |
20 | | - * @return array<string, array{string, string|\UnitEnum, bool, string, string, string}> |
| 21 | + * @return array<string, array{string, string|UnitEnum, bool, string, string, string}> |
21 | 22 | */ |
22 | 23 | public static function casesParameters(): array |
23 | 24 | { |
24 | 25 | return [ |
25 | | - 'as enum instance' => [ |
26 | | - TestEnum::class, |
27 | | - 'data-test', |
28 | | - false, |
29 | | - 'enum: FOO', |
30 | | - ' data-test="FOO"', |
31 | | - "Should return the 'data-test' attribute value for enum case: FOO.", |
| 26 | + 'enum backed integer instance' => [ |
| 27 | + BackedInteger::class, |
| 28 | + BackedInteger::VALUE, |
| 29 | + true, |
| 30 | + 'enum: 1', |
| 31 | + ' 1="1"', |
| 32 | + "Should return the '1' attribute value for enum case: 1.", |
32 | 33 | ], |
33 | | - 'as html' => [ |
34 | | - TestEnum::class, |
| 34 | + 'enum backed string instance' => [ |
| 35 | + BackedString::class, |
35 | 36 | 'data-test', |
36 | 37 | true, |
37 | | - 'enum: BAR', |
38 | | - ' data-test="BAR"', |
39 | | - "Should return the 'data-test' attribute value for enum case: BAR.", |
| 38 | + 'enum: value', |
| 39 | + ' data-test="value"', |
| 40 | + "Should return the 'data-test' attribute value for enum case: value.", |
40 | 41 | ], |
41 | | - 'attribute as enum instance' => [ |
42 | | - TestEnum::class, |
43 | | - TestEnum::FOO, |
44 | | - true, |
45 | | - 'enum: FOO', |
46 | | - ' FOO="FOO"', |
47 | | - "Should return the 'FOO' attribute value for enum case: FOO.", |
| 42 | + 'enum unit instance' => [ |
| 43 | + Unit::class, |
| 44 | + 'data-test', |
| 45 | + false, |
| 46 | + 'enum: value', |
| 47 | + ' data-test="value"', |
| 48 | + "Should return the 'data-test' attribute value for enum case: value.", |
48 | 49 | ], |
49 | 50 | ]; |
50 | 51 | } |
|
0 commit comments