File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
tests/Integration/Generators Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Integration \Generators ;
4+
5+ use Illuminate \Tests \Integration \Generators \TestCase ;
6+
7+ class EnumMakeCommandTest extends TestCase
8+ {
9+ public function testItCanGenerateEnumFile ()
10+ {
11+ $ this ->artisan ('make:enum ' , ['name ' => 'StatusEnum ' ])
12+ ->assertExitCode (0 );
13+
14+ $ this ->assertFileContains ([
15+ 'namespace App; ' ,
16+ 'enum StatusEnum ' ,
17+ ], 'app/StatusEnum.php ' );
18+ }
19+
20+ public function testItCanGenerateEnumFileWithString ()
21+ {
22+ $ this ->artisan ('make:enum ' , ['name ' => 'StringEnum ' , '--string ' => true ])
23+ ->assertExitCode (0 );
24+
25+ $ this ->assertFileContains ([
26+ 'namespace App; ' ,
27+ 'enum StringEnum: string ' ,
28+ ], 'app/StringEnum.php ' );
29+ }
30+
31+ public function testItCanGenerateEnumFileWithInt ()
32+ {
33+ $ this ->artisan ('make:enum ' , ['name ' => 'IntEnum ' , '--int ' => true ])
34+ ->assertExitCode (0 );
35+
36+ $ this ->assertFileContains ([
37+ 'namespace App; ' ,
38+ 'enum IntEnum: int ' ,
39+ ], 'app/IntEnum.php ' );
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments