|
|
|
@ -14,7 +14,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertNotContains("{$this->model_name} model already exists.", app(Kernel::class)->output()); |
|
|
|
|
|
|
|
$this->assertFileExists(app_path($this->model_name.'.php')); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$this->plural_model_name}Controller.php")); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$this->model_name}Controller.php")); |
|
|
|
|
|
|
|
$migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$this->table_name.'_table.php'); |
|
|
|
$this->assertFileExists($migrationFilePath); |
|
|
|
@ -29,7 +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/Feature/Api/Manage{$this->plural_model_name}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$this->model_name}Test.php")); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
@ -41,7 +41,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertContains("We will use existing {$this->model_name} model.", app(Kernel::class)->output()); |
|
|
|
|
|
|
|
$this->assertFileExists(app_path($this->model_name.'.php')); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$this->plural_model_name}Controller.php")); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$this->model_name}Controller.php")); |
|
|
|
|
|
|
|
$migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$this->table_name.'_table.php'); |
|
|
|
$this->assertFileNotExists($migrationFilePath); |
|
|
|
@ -53,7 +53,7 @@ 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->assertFileExists(base_path("tests/Feature/Api/Manage{$this->plural_model_name}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$this->model_name}Test.php")); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
@ -65,7 +65,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertContains("We will use existing Problem model.", app(Kernel::class)->output()); |
|
|
|
|
|
|
|
$this->assertFileExists(app_path('Entities/Projects/Problem.php')); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/ProblemsController.php")); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/ProblemController.php")); |
|
|
|
|
|
|
|
$migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_problems_table.php'); |
|
|
|
$this->assertFileNotExists($migrationFilePath); |
|
|
|
@ -79,7 +79,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->assertFileExists(base_path("tests/Feature/Api/ManageProblemsTest.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/ManageProblemTest.php")); |
|
|
|
|
|
|
|
$this->removeFileOrDir(app_path('Entities/Projects')); |
|
|
|
$this->removeFileOrDir(resource_path('views/problems')); |
|
|
|
@ -101,7 +101,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertNotContains("{$modelName} model already exists.", app(Kernel::class)->output()); |
|
|
|
|
|
|
|
$this->assertFileExists(app_path($modelPath.'/'.$modelName.'.php')); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$pluralModelName}Controller.php")); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$modelName}Controller.php")); |
|
|
|
|
|
|
|
$migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$tableName.'_table.php'); |
|
|
|
$this->assertFileExists($migrationFilePath); |
|
|
|
@ -115,7 +115,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/Feature/Api/Manage{$pluralModelName}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$modelName}Test.php")); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
@ -134,7 +134,7 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertNotContains("{$modelName} model already exists.", app(Kernel::class)->output()); |
|
|
|
|
|
|
|
$this->assertFileExists(app_path($modelPath.'/'.$modelName.'.php')); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$parentName}/{$pluralModelName}Controller.php")); |
|
|
|
$this->assertFileExists(app_path("Http/Controllers/Api/{$parentName}/{$modelName}Controller.php")); |
|
|
|
|
|
|
|
$migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$tableName.'_table.php'); |
|
|
|
$this->assertFileExists($migrationFilePath); |
|
|
|
@ -148,6 +148,6 @@ class CrudApiMakeCommandTest extends TestCase |
|
|
|
$this->assertFileExists(database_path("factories/{$modelName}Factory.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Unit/Models/{$modelName}Test.php")); |
|
|
|
$this->assertFileExists(app_path("Policies/{$parentName}/{$modelName}Policy.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$pluralModelName}Test.php")); |
|
|
|
$this->assertFileExists(base_path("tests/Feature/Api/Manage{$modelName}Test.php")); |
|
|
|
} |
|
|
|
} |