diff --git a/src/Commands/Make/TestMakeCommand.php b/src/Commands/Make/TestMakeCommand.php index 105861903..e2bacea1a 100644 --- a/src/Commands/Make/TestMakeCommand.php +++ b/src/Commands/Make/TestMakeCommand.php @@ -61,11 +61,7 @@ protected function getOptions() protected function getTemplateContents() { $module = $this->laravel['modules']->findOrFail($this->getModuleName()); - $stub = '/unit-test.stub'; - - if ($this->option('feature')) { - $stub = '/feature-test.stub'; - } + $stub = '/tests/'.(($this->option('feature')) ? 'feature' : 'unit').'.stub'; return (new Stub($stub, [ 'NAMESPACE' => $this->getClassNamespace($module), diff --git a/src/Commands/stubs/feature-test.stub b/src/Commands/stubs/tests/feature.stub similarity index 52% rename from src/Commands/stubs/feature-test.stub rename to src/Commands/stubs/tests/feature.stub index 316953493..db7d415e9 100644 --- a/src/Commands/stubs/feature-test.stub +++ b/src/Commands/stubs/tests/feature.stub @@ -3,15 +3,13 @@ namespace $NAMESPACE$; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class $CLASS$ extends TestCase { /** - * A basic feature test example. + * A basic test example. */ - public function testExample(): void + public function test_the_application_returns_a_successful_response(): void { $response = $this->get('/'); diff --git a/src/Commands/stubs/tests/unit.stub b/src/Commands/stubs/tests/unit.stub new file mode 100644 index 000000000..938e5da00 --- /dev/null +++ b/src/Commands/stubs/tests/unit.stub @@ -0,0 +1,16 @@ +assertTrue(true); + } +} diff --git a/src/Commands/stubs/unit-test.stub b/src/Commands/stubs/unit-test.stub deleted file mode 100644 index be0bd559b..000000000 --- a/src/Commands/stubs/unit-test.stub +++ /dev/null @@ -1,20 +0,0 @@ -assertTrue(true); - } -} diff --git a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace__1.txt b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace__1.txt index dba6e35a1..3986e14b4 100644 --- a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace__1.txt +++ b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace__1.txt @@ -3,15 +3,13 @@ namespace Modules\Blog\SuperTests\Feature; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class EloquentPostRepositoryTest extends TestCase { /** - * A basic feature test example. + * A basic test example. */ - public function testExample(): void + public function test_the_application_returns_a_successful_response(): void { $response = $this->get('/'); diff --git a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace_specific__1.txt b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace_specific__1.txt index dba6e35a1..3986e14b4 100644 --- a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace_specific__1.txt +++ b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_feature_namespace_specific__1.txt @@ -3,15 +3,13 @@ namespace Modules\Blog\SuperTests\Feature; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class EloquentPostRepositoryTest extends TestCase { /** - * A basic feature test example. + * A basic test example. */ - public function testExample(): void + public function test_the_application_returns_a_successful_response(): void { $response = $this->get('/'); diff --git a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace__1.txt b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace__1.txt index 273dc9657..ae35f4fe3 100644 --- a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace__1.txt +++ b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace__1.txt @@ -3,17 +3,13 @@ namespace Modules\Blog\SuperTests\Unit; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class EloquentPostRepositoryTest extends TestCase { /** - * A basic unit test example. - * - * @return void + * A basic test example. */ - public function testExample() + public function test_that_true_is_true(): void { $this->assertTrue(true); } diff --git a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace_specific__1.txt b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace_specific__1.txt index fcbfc0da3..d6cc19884 100644 --- a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace_specific__1.txt +++ b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_can_change_the_default_unit_namespace_specific__1.txt @@ -3,17 +3,13 @@ namespace Modules\Blog\Tests\Unit; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class EloquentPostRepositoryTest extends TestCase { /** - * A basic unit test example. - * - * @return void + * A basic test example. */ - public function testExample() + public function test_that_true_is_true(): void { $this->assertTrue(true); } diff --git a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_feature_file_with_content__1.txt b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_feature_file_with_content__1.txt index 6378738a3..f59071152 100644 --- a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_feature_file_with_content__1.txt +++ b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_feature_file_with_content__1.txt @@ -3,15 +3,13 @@ namespace Modules\Blog\Tests\Feature; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class EloquentPostRepositoryTest extends TestCase { /** - * A basic feature test example. + * A basic test example. */ - public function testExample(): void + public function test_the_application_returns_a_successful_response(): void { $response = $this->get('/'); diff --git a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_unit_file_with_content__1.txt b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_unit_file_with_content__1.txt index fcbfc0da3..d6cc19884 100644 --- a/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_unit_file_with_content__1.txt +++ b/tests/Commands/Make/__snapshots__/TestMakeCommandTest__test_it_generated_correct_unit_file_with_content__1.txt @@ -3,17 +3,13 @@ namespace Modules\Blog\Tests\Unit; use Tests\TestCase; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; class EloquentPostRepositoryTest extends TestCase { /** - * A basic unit test example. - * - * @return void + * A basic test example. */ - public function testExample() + public function test_that_true_is_true(): void { $this->assertTrue(true); }