|
|
|
@ -137,7 +137,8 @@ class CrudMake extends Command |
|
|
|
|
|
|
|
public function getUnitTestContent() |
|
|
|
{ |
|
|
|
return $this->files->get(__DIR__.'/stubs/unit-test.stub'); |
|
|
|
$stub = $this->files->get(__DIR__.'/stubs/unit-test.stub'); |
|
|
|
return $this->replaceUnitTestDummyStrings($stub)->replaceClass($stub); |
|
|
|
} |
|
|
|
|
|
|
|
protected function makeDirectory($path) |
|
|
|
@ -171,6 +172,17 @@ class CrudMake extends Command |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
protected function replaceUnitTestDummyStrings(&$stub) |
|
|
|
{ |
|
|
|
$stub = str_replace( |
|
|
|
['DummyClass'], |
|
|
|
[$this->modelName.'Test'], |
|
|
|
$stub |
|
|
|
); |
|
|
|
|
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
protected function replaceClass($stub) |
|
|
|
{ |
|
|
|
$class = str_plural($this->modelName); |
|
|
|
|