Skip to content

Commit

Permalink
[11.x] Test Improvements (#51847)
Browse files Browse the repository at this point in the history
* [11.x] Test Improvements

Verify generated class doesn't contain `.php` file extension.

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Jun 20, 2024
1 parent 9a650d5 commit c839b3e
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 @@ -12,6 +12,7 @@ class GeneratorCommandTest extends TestCase

protected $files = [
'app/Console/Commands/FooCommand.php',
'resources/views/foo/php.blade.php',
];

public function testItChopsPhpExtension()
Expand All @@ -20,6 +21,18 @@ public function testItChopsPhpExtension()
->assertExitCode(0);

$this->assertFilenameExists('app/Console/Commands/FooCommand.php');

$this->assertFileContains([
'class FooCommand extends Command',
], 'app/Console/Commands/FooCommand.php');
}

public function testItChopsPhpExtensionFromMakeViewCommands()
{
$this->artisan('make:view', ['name' => 'foo.php'])
->assertExitCode(0);

$this->assertFilenameExists('resources/views/foo/php.blade.php');
}

#[DataProvider('reservedNamesDataProvider')]
Expand Down

0 comments on commit c839b3e

Please sign in to comment.