diff --git a/tests/Integration/Generators/ClassMakeCommandTest.php b/tests/Integration/Generators/ClassMakeCommandTest.php new file mode 100644 index 000000000000..ebfa0269b385 --- /dev/null +++ b/tests/Integration/Generators/ClassMakeCommandTest.php @@ -0,0 +1,33 @@ +artisan('make:class', ['name' => 'Reverb']) + ->assertExitCode(0); + + $this->assertFileContains([ + 'namespace App;', + 'class Reverb', + 'public function __construct()', + ], 'app/Reverb.php'); + } + + public function testItCanGenerateInvokableClassFile() + { + $this->artisan('make:class', ['name' => 'Notification', '--invokable' => true]) + ->assertExitCode(0); + + $this->assertFileContains([ + 'namespace App;', + 'class Notification', + 'public function __construct()', + 'public function __invoke()', + ], 'app/Notification.php'); + } +} diff --git a/tests/Integration/Generators/InterfaceMakeCommandTest.php b/tests/Integration/Generators/InterfaceMakeCommandTest.php new file mode 100644 index 000000000000..ae40c4c32ffb --- /dev/null +++ b/tests/Integration/Generators/InterfaceMakeCommandTest.php @@ -0,0 +1,19 @@ +artisan('make:interface', ['name' => 'Gateway']) + ->assertExitCode(0); + + $this->assertFileContains([ + 'namespace App;', + 'interface Gateway', + ], 'app/Gateway.php'); + } +}