Skip to content

Commit 6b9c36d

Browse files
committed
TEST
1 parent d775c5c commit 6b9c36d

File tree

4 files changed

+14
-26
lines changed

4 files changed

+14
-26
lines changed

.github/workflows/run-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
os: [ ubuntu-latest ]
1616
php: [ 8.2 ]
1717
laravel: [ 10.*,11.* ]
18-
stability: [ prefer-lowest, prefer-stable ]
1918

2019
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2120

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ composer require webfox/laravel-backed-enums
1515

1616
### Make Command
1717

18-
Conveniently create a new laravel backed enum using the existing enum make command.
18+
Creating a new Laravel Backed Enum is easy with the make:enum command.
1919

2020
#### Command:
2121

2222
```Bash
23-
php artisan make:enum {name} {type?}
23+
php artisan make:enum {name} --string # or --int
2424
```
2525

2626
#### Arguments:

src/LaravelBackedEnumMakeCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use InvalidArgumentException;
66
use Illuminate\Foundation\Console\EnumMakeCommand;
77

8-
98
class LaravelBackedEnumMakeCommand extends EnumMakeCommand
109
{
1110
protected $description = 'Create a new laravel backed enum';

tests/MakeEnumCommandTest.php

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,19 @@
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-
138
if (File::exists(workbench_path('app/Enums/TestEnum.php'))) {
149
File::delete(workbench_path('app/Enums/TestEnum.php'));
1510
}
1611
artisan('make:enum TestEnum -s')
1712
->execute();
1813

19-
20-
21-
22-
2314
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");
2518

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

28-
/** @noinspection PhpFullyQualifiedNameUsageInspection */
29-
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;
30-
3121
if (File::exists(workbench_path('app/Enums/PureEnum.php'))) {
3222
File::delete(workbench_path('app/Enums/PureEnum.php'));
3323
}
@@ -41,13 +31,12 @@
4131
$actualContents = File::get(workbench_path('app/Enums/PureEnum.php'));
4232

4333
expect($actualContents)->toEqual($expectedContents);
44-
});
34+
})
35+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
36+
->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only");
4537

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

48-
/** @noinspection PhpFullyQualifiedNameUsageInspection */
49-
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;
50-
5140
if (File::exists(workbench_path('app/Enums/StringEnum.php'))) {
5241
File::delete(workbench_path('app/Enums/StringEnum.php'));
5342
}
@@ -61,13 +50,12 @@
6150
$actualContents = File::get(workbench_path('app/Enums/StringEnum.php'));
6251

6352
expect($actualContents)->toEqual($expectedContents);
64-
});
53+
})
54+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
55+
->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only");
6556

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

68-
/** @noinspection PhpFullyQualifiedNameUsageInspection */
69-
if (!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class)) return;
70-
7159
if (File::exists(workbench_path('app/Enums/IntEnum.php'))) {
7260
File::delete(workbench_path('app/Enums/IntEnum.php'));
7361
}
@@ -81,4 +69,6 @@
8169
$actualContents = File::get(workbench_path('app/Enums/IntEnum.php'));
8270

8371
expect($actualContents)->toEqual($expectedContents);
84-
});
72+
})
73+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
74+
->skip(!class_exists(\Illuminate\Foundation\Console\EnumMakeCommand::class), "Laravel 11 only");

0 commit comments

Comments
 (0)