Browse Source

Remove view generation on crud-api command

tags/1.1.0
Nafies Luthfi 8 years ago
parent
commit
09e7c36c5d
  1. 2
      src/CrudApiMake.php
  2. 15
      tests/CrudApiMakeCommandTest.php
  3. 2
      tests/Generators/Api/ApiControllerGeneratorTest.php

2
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');
}
}

15
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"));

2
tests/Generators/Api/ApiControllerGeneratorTest.php

@ -1,6 +1,6 @@
<?php
namespace Tests\Generators\Simple;
namespace Tests\Generators\Api;
use Tests\TestCase;

Loading…
Cancel
Save