From 09e7c36c5dcf77d8c9fdb42da9b4fe57c00ff2b5 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Thu, 29 Mar 2018 06:46:00 +0800 Subject: [PATCH] Remove view generation on crud-api command --- src/CrudApiMake.php | 2 -- tests/CrudApiMakeCommandTest.php | 15 ++++++--------- tests/Generators/Api/ApiControllerGeneratorTest.php | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/CrudApiMake.php b/src/CrudApiMake.php index 0dbf6cf..c9289cc 100644 --- a/src/CrudApiMake.php +++ b/src/CrudApiMake.php @@ -107,7 +107,5 @@ class CrudApiMake extends GeneratorCommand public function generateResources() { app('Luthfi\CrudGenerator\Generators\LangFileGenerator', ['command' => $this])->generate(); - app('Luthfi\CrudGenerator\Generators\FormViewGenerator', ['command' => $this])->generate('simple'); - app('Luthfi\CrudGenerator\Generators\IndexViewGenerator', ['command' => $this])->generate('simple'); } } diff --git a/tests/CrudApiMakeCommandTest.php b/tests/CrudApiMakeCommandTest.php index 3bcc738..bdcf21b 100644 --- a/tests/CrudApiMakeCommandTest.php +++ b/tests/CrudApiMakeCommandTest.php @@ -19,8 +19,8 @@ class CrudApiMakeCommandTest extends TestCase $migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$this->table_name.'_table.php'); $this->assertFileExists($migrationFilePath); - $this->assertFileExists(resource_path("views/{$this->table_name}/index.blade.php")); - $this->assertFileExists(resource_path("views/{$this->table_name}/forms.blade.php")); + $this->assertFileNotExists(resource_path("views/{$this->table_name}/index.blade.php")); + $this->assertFileNotExists(resource_path("views/{$this->table_name}/forms.blade.php")); $localeConfig = config('app.locale'); $this->assertFileExists(resource_path("lang/{$localeConfig}/{$this->lang_name}.php")); @@ -46,9 +46,6 @@ class CrudApiMakeCommandTest extends TestCase $migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$this->table_name.'_table.php'); $this->assertFileNotExists($migrationFilePath); - $this->assertFileNotExists(resource_path("views/{$this->table_name}/index.blade.php")); - $this->assertFileNotExists(resource_path("views/{$this->table_name}/forms.blade.php")); - $localeConfig = config('app.locale'); $this->assertFileNotExists(resource_path("lang/{$localeConfig}/{$this->lang_name}.php")); @@ -109,8 +106,8 @@ class CrudApiMakeCommandTest extends TestCase $migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$tableName.'_table.php'); $this->assertFileExists($migrationFilePath); - $this->assertFileExists(resource_path("views/{$tableName}/index.blade.php")); - $this->assertFileExists(resource_path("views/{$tableName}/forms.blade.php")); + $this->assertFileNotExists(resource_path("views/{$tableName}/index.blade.php")); + $this->assertFileNotExists(resource_path("views/{$tableName}/forms.blade.php")); $localeConfig = config('app.locale'); $this->assertFileExists(resource_path("lang/{$localeConfig}/{$langName}.php")); @@ -142,8 +139,8 @@ class CrudApiMakeCommandTest extends TestCase $migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$tableName.'_table.php'); $this->assertFileExists($migrationFilePath); - $this->assertFileExists(resource_path("views/{$tableName}/index.blade.php")); - $this->assertFileExists(resource_path("views/{$tableName}/forms.blade.php")); + $this->assertFileNotExists(resource_path("views/{$tableName}/index.blade.php")); + $this->assertFileNotExists(resource_path("views/{$tableName}/forms.blade.php")); $localeConfig = config('app.locale'); $this->assertFileExists(resource_path("lang/{$localeConfig}/{$langName}.php")); diff --git a/tests/Generators/Api/ApiControllerGeneratorTest.php b/tests/Generators/Api/ApiControllerGeneratorTest.php index a2d6142..1423974 100644 --- a/tests/Generators/Api/ApiControllerGeneratorTest.php +++ b/tests/Generators/Api/ApiControllerGeneratorTest.php @@ -1,6 +1,6 @@