Browse Source

Change dummy entity string to keyword : master

tags/0.1.0
Nafies Luthfi 8 years ago
parent
commit
dccc38c777
  1. 12
      src/CrudMake.php
  2. 6
      src/stubs/migration-create.stub
  3. 2
      src/stubs/test.stub
  4. 4
      src/stubs/unit-test.stub
  5. 2
      tests/Generators/ModelTestGeneratorTest.php

12
src/CrudMake.php

@ -167,8 +167,8 @@ class CrudMake extends Command
protected function replaceFeatureTestDummyStrings(&$stub)
{
$stub = str_replace(
['DummyClass'],
['Manage'.$this->pluralModelName.'Test'],
['Masters'],
[$this->pluralModelName],
$stub
);
@ -178,8 +178,8 @@ class CrudMake extends Command
protected function replaceUnitTestDummyStrings(&$stub)
{
$stub = str_replace(
['DummyClass'],
[$this->modelName.'Test'],
['Master'],
[$this->modelName],
$stub
);
@ -189,8 +189,8 @@ class CrudMake extends Command
protected function replaceMigrationDummyStrings(&$stub)
{
$stub = str_replace(
['DummyTable', 'DummyClass'],
[$this->lowerCasePluralModel, 'Create'.$this->pluralModelName.'Table'],
['masters', 'Masters'],
[$this->lowerCasePluralModel, $this->pluralModelName],
$stub
);

6
src/stubs/migration-create.stub

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DummyClass extends Migration
class CreateMastersTable extends Migration
{
/**
* Run the migrations.
@ -13,7 +13,7 @@ class DummyClass extends Migration
*/
public function up()
{
Schema::create('DummyTable', function (Blueprint $table) {
Schema::create('masters', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 60);
$table->string('description');
@ -28,6 +28,6 @@ class DummyClass extends Migration
*/
public function down()
{
Schema::dropIfExists('DummyTable');
Schema::dropIfExists('masters');
}
}

2
src/stubs/test.stub

@ -5,7 +5,7 @@ namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class DummyClass extends TestCase
class ManageMastersTest extends TestCase
{
/**
* A basic test example.

4
src/stubs/unit-test.stub

@ -1,11 +1,11 @@
<?php
namespace DummyNamespace;
namespace Tests\Unit\Models;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class DummyClass extends TestCase
class MasterTest extends TestCase
{
/**
* A basic test example.

2
tests/Generators/ModelTestGeneratorTest.php

@ -14,7 +14,7 @@ class ModelTestGeneratorTest extends TestCase
$this->assertFileExists(base_path("tests/Unit/Models/{$this->modelName}Test.php"));
$modelClassContent = "<?php
namespace DummyNamespace;
namespace Tests\Unit\Models;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;

Loading…
Cancel
Save