|
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 | + if (File::exists(workbench_path('app/Enums/TestEnum.php'))) { |
| 14 | + File::delete(workbench_path('app/Enums/TestEnum.php')); |
| 15 | + } |
8 | 16 | artisan('make:enum TestEnum -s') |
9 | 17 | ->execute(); |
10 | 18 |
|
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
11 | 23 | expect(workbench_path('app/Enums/TestEnum.php'))->toBeFile(); |
12 | 24 | }); |
13 | 25 |
|
14 | 26 | it('can make pure enum', function () { |
15 | 27 |
|
| 28 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 29 | + if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
| 30 | + |
16 | 31 | if (File::exists(workbench_path('app/Enums/PureEnum.php'))) { |
17 | 32 | File::delete(workbench_path('app/Enums/PureEnum.php')); |
18 | 33 | } |
|
30 | 45 |
|
31 | 46 | it('can make string enum', function () { |
32 | 47 |
|
| 48 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 49 | + if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
| 50 | + |
33 | 51 | if (File::exists(workbench_path('app/Enums/StringEnum.php'))) { |
34 | 52 | File::delete(workbench_path('app/Enums/StringEnum.php')); |
35 | 53 | } |
|
46 | 64 | }); |
47 | 65 |
|
48 | 66 | it('can make int enum', function () { |
| 67 | + |
| 68 | + /** @noinspection PhpFullyQualifiedNameUsageInspection */ |
| 69 | + if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return; |
| 70 | + |
49 | 71 | if (File::exists(workbench_path('app/Enums/IntEnum.php'))) { |
50 | 72 | File::delete(workbench_path('app/Enums/IntEnum.php')); |
51 | 73 | } |
|
0 commit comments