diff --git a/src/CrudMake.php b/src/CrudMake.php index 869ee4b..2504ad4 100644 --- a/src/CrudMake.php +++ b/src/CrudMake.php @@ -131,7 +131,8 @@ class CrudMake extends Command public function getFeatureTestContent() { - return $this->files->get(__DIR__.'/stubs/test.stub'); + $stub = $this->files->get(__DIR__.'/stubs/test.stub'); + return $this->replaceFeatureTestDummyStrings($stub)->replaceClass($stub); } public function getUnitTestContent() @@ -159,6 +160,17 @@ class CrudMake extends Command return $this; } + protected function replaceFeatureTestDummyStrings(&$stub) + { + $stub = str_replace( + ['DummyClass'], + ['Manage'.$this->pluralModelName.'Test'], + $stub + ); + + return $this; + } + protected function replaceClass($stub) { $class = str_plural($this->modelName); diff --git a/src/stubs/test.stub b/src/stubs/test.stub index dd804dc..4bc1133 100644 --- a/src/stubs/test.stub +++ b/src/stubs/test.stub @@ -1,11 +1,9 @@ assertFileExists(base_path('tests/Feature/ManageItemsTest.php')); $modelClassContent = "