Skip to content

Commit d775c5c

Browse files
committed
TEST
1 parent 18ce1a7 commit d775c5c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/MakeEnumCommandTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,29 @@
55
use function Orchestra\Testbench\workbench_path;
66

77
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+
}
816
artisan('make:enum TestEnum -s')
917
->execute();
1018

19+
20+
21+
22+
1123
expect(workbench_path('app/Enums/TestEnum.php'))->toBeFile();
1224
});
1325

1426
it('can make pure enum', function () {
1527

28+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
29+
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;
30+
1631
if (File::exists(workbench_path('app/Enums/PureEnum.php'))) {
1732
File::delete(workbench_path('app/Enums/PureEnum.php'));
1833
}
@@ -30,6 +45,9 @@
3045

3146
it('can make string enum', function () {
3247

48+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
49+
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;
50+
3351
if (File::exists(workbench_path('app/Enums/StringEnum.php'))) {
3452
File::delete(workbench_path('app/Enums/StringEnum.php'));
3553
}
@@ -46,6 +64,10 @@
4664
});
4765

4866
it('can make int enum', function () {
67+
68+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
69+
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;
70+
4971
if (File::exists(workbench_path('app/Enums/IntEnum.php'))) {
5072
File::delete(workbench_path('app/Enums/IntEnum.php'));
5173
}

0 commit comments

Comments
 (0)