|
|
|
@ -29,6 +29,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertFileExists(app_path("Policies/{$this->model_name}Policy.php")); |
|
|
|
$this->assertFileExists(database_path("factories/{$this->model_name}Factory.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Models/{$this->model_name}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Policies/{$this->model_name}PolicyTest.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$this->model_name}Test.php")); |
|
|
|
} |
|
|
|
|
|
|
|
@ -53,11 +54,12 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertFileNotExists(app_path("Policies/{$this->model_name}Policy.php")); |
|
|
|
$this->assertFileNotExists(database_path("factories/{$this->model_name}Factory.php")); |
|
|
|
$this->assertFileNotExists(base_path("tests/Unit/Models/{$this->model_name}Test.php")); |
|
|
|
$this->assertFileNotExists(base_path("tests/Unit/Policies/{$this->model_name}PolicyTest.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$this->model_name}Test.php")); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
public function it_cannot_generate_crud_files_if_namespaced_model_exists() |
|
|
|
public function it_not_generate_api_crud_files_if_namespaced_model_exists() |
|
|
|
{ |
|
|
|
$this->artisan('make:model', ['name' => 'Entities/Projects/Problem', '--no-interaction' => true]); |
|
|
|
$this->artisan('make:crud-api', ['name' => 'Entities/Projects/Problem', '--no-interaction' => true]); |
|
|
|
@ -79,6 +81,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertFileNotExists(app_path("Policies/ProblemPolicy.php")); |
|
|
|
$this->assertFileNotExists(database_path("factories/ProblemFactory.php")); |
|
|
|
$this->assertFileNotExists(base_path("tests/Unit/Models/ProblemTest.php")); |
|
|
|
$this->assertFileNotExists(base_path("tests/Unit/Policies/ProblemPolicyTest.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/ManageProblemTest.php")); |
|
|
|
|
|
|
|
$this->removeFileOrDir(app_path('Entities/Projects')); |
|
|
|
@ -115,6 +118,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertFileExists(app_path("Policies/{$modelName}Policy.php")); |
|
|
|
$this->assertFileExists(database_path("factories/{$modelName}Factory.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Models/{$modelName}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Policies/{$modelName}PolicyTest.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$modelName}Test.php")); |
|
|
|
} |
|
|
|
|
|
|
|
@ -147,6 +151,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
|
|
|
|
$this->assertFileExists(database_path("factories/{$modelName}Factory.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Models/{$modelName}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Policies/{$modelName}PolicyTest.php")); |
|
|
|
$this->assertFileExists(app_path("Policies/{$parentName}/{$modelName}Policy.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$modelName}Test.php")); |
|
|
|
} |
|
|
|
|