|
5 | 5 | use function Orchestra\Testbench\workbench_path; |
6 | 6 |
|
7 | 7 | it('can create an enum', function () { |
8 | | - |
9 | | - |
10 | | - /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
11 | | - if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
12 | | - |
13 | 8 | if (File::exists(workbench_path('app/Enums/TestEnum.php'))) { |
14 | 9 | File::delete(workbench_path('app/Enums/TestEnum.php')); |
15 | 10 | } |
16 | 11 | artisan('make:enum TestEnum -s') |
17 | 12 | ->execute(); |
18 | 13 |
|
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | 14 | expect(workbench_path('app/Enums/TestEnum.php'))->toBeFile(); |
24 | | -}); |
| 15 | +}) |
| 16 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 17 | + ->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only"); |
25 | 18 |
|
26 | 19 | it('can make pure enum', function () { |
27 | 20 |
|
28 | | - /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
29 | | - if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
30 | | - |
31 | 21 | if (File::exists(workbench_path('app/Enums/PureEnum.php'))) { |
32 | 22 | File::delete(workbench_path('app/Enums/PureEnum.php')); |
33 | 23 | } |
|
41 | 31 | $actualContents = File::get(workbench_path('app/Enums/PureEnum.php')); |
42 | 32 |
|
43 | 33 | expect($actualContents)->toEqual($expectedContents); |
44 | | -}); |
| 34 | +}) |
| 35 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 36 | + ->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only"); |
45 | 37 |
|
46 | 38 | it('can make string enum', function () { |
47 | 39 |
|
48 | | - /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
49 | | - if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
50 | | - |
51 | 40 | if (File::exists(workbench_path('app/Enums/StringEnum.php'))) { |
52 | 41 | File::delete(workbench_path('app/Enums/StringEnum.php')); |
53 | 42 | } |
|
61 | 50 | $actualContents = File::get(workbench_path('app/Enums/StringEnum.php')); |
62 | 51 |
|
63 | 52 | expect($actualContents)->toEqual($expectedContents); |
64 | | -}); |
| 53 | +}) |
| 54 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 55 | + ->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only"); |
65 | 56 |
|
66 | 57 | it('can make int enum', function () { |
67 | 58 |
|
68 | | - /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
69 | | - if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
70 | | - |
71 | 59 | if (File::exists(workbench_path('app/Enums/IntEnum.php'))) { |
72 | 60 | File::delete(workbench_path('app/Enums/IntEnum.php')); |
73 | 61 | } |
|
81 | 69 | $actualContents = File::get(workbench_path('app/Enums/IntEnum.php')); |
82 | 70 |
|
83 | 71 | expect($actualContents)->toEqual($expectedContents); |
84 | | -}); |
| 72 | +}) |
| 73 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 74 | + ->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only"); |
0 commit comments