Skip to content

Commit

Permalink
Update EnumMakeCommandTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Mar 7, 2024
1 parent 9fda77f commit 60a92da
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Integration/Generators/EnumMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Integration\Generators;

use Illuminate\Support\Facades\File;
use Illuminate\Tests\Integration\Generators\TestCase;

class EnumMakeCommandTest extends TestCase
Expand Down Expand Up @@ -38,4 +39,17 @@ public function testItCanGenerateEnumFileWithInt()
'enum IntEnum: int',
], 'app/IntEnum.php');
}

public function testItCanGenerateEnumFileInEnumsFolder()
{
File::makeDirectory(app_path() . '\\Enums', force: true);

$this->artisan('make:enum', ['name' => 'ImplicitEnum'])
->assertExitCode(0);

$this->assertFileContains([
'namespace App\Enums;',
'enum ImplicitEnum',
], 'app/Enums/ImplicitEnum.php');
}
}

0 comments on commit 60a92da

Please sign in to comment.