Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim-Webfox committed Jan 21, 2025
1 parent 18ce1a7 commit d775c5c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/MakeEnumCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@
use function Orchestra\Testbench\workbench_path;

it('can create an enum', function () {


/** @noinspection PhpFullyQualifiedNameUsageInspection */
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;

if (File::exists(workbench_path('app/Enums/TestEnum.php'))) {
File::delete(workbench_path('app/Enums/TestEnum.php'));
}
artisan('make:enum TestEnum -s')
->execute();





expect(workbench_path('app/Enums/TestEnum.php'))->toBeFile();
});

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

/** @noinspection PhpFullyQualifiedNameUsageInspection */
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;

if (File::exists(workbench_path('app/Enums/PureEnum.php'))) {
File::delete(workbench_path('app/Enums/PureEnum.php'));
}
Expand All @@ -30,6 +45,9 @@

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

/** @noinspection PhpFullyQualifiedNameUsageInspection */
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;

if (File::exists(workbench_path('app/Enums/StringEnum.php'))) {
File::delete(workbench_path('app/Enums/StringEnum.php'));
}
Expand All @@ -46,6 +64,10 @@
});

it('can make int enum', function () {

/** @noinspection PhpFullyQualifiedNameUsageInspection */
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;

if (File::exists(workbench_path('app/Enums/IntEnum.php'))) {
File::delete(workbench_path('app/Enums/IntEnum.php'));
}
Expand Down

0 comments on commit d775c5c

Please sign in to comment.