From c839b3e7775980272b995238ea529dcb3d6e46d3 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 20 Jun 2024 22:37:55 +0800 Subject: [PATCH] [11.x] Test Improvements (#51847) * [11.x] Test Improvements Verify generated class doesn't contain `.php` file extension. Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki --------- Signed-off-by: Mior Muhammad Zaki --- tests/Integration/Console/GeneratorCommandTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Integration/Console/GeneratorCommandTest.php b/tests/Integration/Console/GeneratorCommandTest.php index 0709691166c1..e840dfc982cc 100644 --- a/tests/Integration/Console/GeneratorCommandTest.php +++ b/tests/Integration/Console/GeneratorCommandTest.php @@ -12,6 +12,7 @@ class GeneratorCommandTest extends TestCase protected $files = [ 'app/Console/Commands/FooCommand.php', + 'resources/views/foo/php.blade.php', ]; public function testItChopsPhpExtension() @@ -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')]