Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmccreary committed Jun 26, 2024
1 parent 1076c91 commit eca494d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Integration/Console/GeneratorCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class GeneratorCommandTest extends TestCase
protected $files = [
'app/Console/Commands/FooCommand.php',
'resources/views/foo/php.blade.php',
'tests/Feature/fixtures.php/SomeTest.php',
];

public function testItChopsPhpExtension()
Expand All @@ -35,6 +36,18 @@ public function testItChopsPhpExtensionFromMakeViewCommands()
$this->assertFilenameExists('resources/views/foo/php.blade.php');
}

public function testItOnlyChopsPhpExtensionFromFilename()
{
$this->artisan('make:test', ['name' => 'fixtures.php/SomeTest'])
->assertExitCode(0);

$this->assertFilenameExists('tests/Feature/fixtures.php/SomeTest.php');

$this->assertFileContains([
'class SomeTest extends TestCase',
], 'tests/Feature/fixtures.php/SomeTest.php');
}

#[DataProvider('reservedNamesDataProvider')]
public function testItCannotGenerateClassUsingReservedName($given)
{
Expand Down

0 comments on commit eca494d

Please sign in to comment.