From 63a0cfd3d8e62145f2d3d4f41b71f35d8402368d Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Fri, 2 Nov 2018 07:43:53 +0800 Subject: [PATCH] Update validation field name comment on test --- src/stubs/testcases/feature/api.stub | 12 ++++---- src/stubs/testcases/feature/full.stub | 12 ++++---- src/stubs/testcases/feature/simple.stub | 12 ++++---- .../Generators/Api/ApiFeatureTestGeneratorTest.php | 24 +++++++-------- tests/Generators/FeatureTestGeneratorTest.php | 36 +++++++++++----------- .../Generators/Simple/FeatureTestGeneratorTest.php | 24 +++++++-------- 6 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/stubs/testcases/feature/api.stub b/src/stubs/testcases/feature/api.stub index 0a98561..bfc94c9 100644 --- a/src/stubs/testcases/feature/api.stub +++ b/src/stubs/testcases/feature/api.stub @@ -61,7 +61,7 @@ class ManageMasterTest extends TestCase { $user = $this->createUser(); - // Name empty + // name empty $requestBody = $this->getCreateFields(['name' => '']); $this->postJson( route('api.masters.store'), @@ -78,7 +78,7 @@ class ManageMasterTest extends TestCase { $user = $this->createUser(); - // Name 70 characters + // name 70 characters $requestBody = $this->getCreateFields(['name' => str_repeat('Test Title', 7)]); $this->postJson( route('api.masters.store'), @@ -95,7 +95,7 @@ class ManageMasterTest extends TestCase { $user = $this->createUser(); - // Description 256 characters + // description 256 characters $requestBody = $this->getCreateFields(['description' => str_repeat('Long description', 16)]); $this->postJson( route('api.masters.store'), @@ -160,7 +160,7 @@ class ManageMasterTest extends TestCase $user = $this->createUser(); $singleMstr = factory(Vehicle::class)->create(); - // Name empty + // name empty $requestBody = $this->getEditFields(['name' => '']); $this->patchJson( route('api.masters.update', $singleMstr), @@ -178,7 +178,7 @@ class ManageMasterTest extends TestCase $user = $this->createUser(); $singleMstr = factory(Vehicle::class)->create(); - // Name 70 characters + // name 70 characters $requestBody = $this->getEditFields(['name' => str_repeat('Test Title', 7)]); $this->patchJson( route('api.masters.update', $singleMstr), @@ -196,7 +196,7 @@ class ManageMasterTest extends TestCase $user = $this->createUser(); $singleMstr = factory(Vehicle::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters $requestBody = $this->getEditFields(['description' => str_repeat('Long description', 16)]); $this->patchJson( route('api.masters.update', $singleMstr), diff --git a/src/stubs/testcases/feature/full.stub b/src/stubs/testcases/feature/full.stub index 65ff3f2..e6d994b 100644 --- a/src/stubs/testcases/feature/full.stub +++ b/src/stubs/testcases/feature/full.stub @@ -49,7 +49,7 @@ class ManageMasterTest extends TestCase { $this->loginAsUser(); - // Name empty + // name empty $this->post(route('masters.store'), $this->getCreateFields(['name' => ''])); $this->assertSessionHasErrors('name'); } @@ -59,7 +59,7 @@ class ManageMasterTest extends TestCase { $this->loginAsUser(); - // Name 70 characters + // name 70 characters $this->post(route('masters.store'), $this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -71,7 +71,7 @@ class ManageMasterTest extends TestCase { $this->loginAsUser(); - // Description 256 characters + // description 256 characters $this->post(route('masters.store'), $this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -111,7 +111,7 @@ class ManageMasterTest extends TestCase $this->loginAsUser(); $master = factory(Master::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty $this->patch(route('masters.update', $master), $this->getEditFields(['name' => ''])); $this->assertSessionHasErrors('name'); } @@ -122,7 +122,7 @@ class ManageMasterTest extends TestCase $this->loginAsUser(); $master = factory(Master::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters $this->patch(route('masters.update', $master), $this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -135,7 +135,7 @@ class ManageMasterTest extends TestCase $this->loginAsUser(); $master = factory(Master::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters $this->patch(route('masters.update', $master), $this->getEditFields([ 'description' => str_repeat('Long description', 16), ])); diff --git a/src/stubs/testcases/feature/simple.stub b/src/stubs/testcases/feature/simple.stub index 988d381..e9848ef 100644 --- a/src/stubs/testcases/feature/simple.stub +++ b/src/stubs/testcases/feature/simple.stub @@ -55,7 +55,7 @@ class ManageMasterTest extends TestCase { $this->loginAsUser(); - // Name empty + // name empty $this->post(route('masters.store'), $this->getCreateFields(['name' => ''])); $this->assertSessionHasErrors('name'); } @@ -65,7 +65,7 @@ class ManageMasterTest extends TestCase { $this->loginAsUser(); - // Name 70 characters + // name 70 characters $this->post(route('masters.store'), $this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -77,7 +77,7 @@ class ManageMasterTest extends TestCase { $this->loginAsUser(); - // Description 256 characters + // description 256 characters $this->post(route('masters.store'), $this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -121,7 +121,7 @@ class ManageMasterTest extends TestCase $this->loginAsUser(); $master = factory(Master::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty $this->patch(route('masters.update', $master), $this->getEditFields(['name' => ''])); $this->assertSessionHasErrors('name'); } @@ -132,7 +132,7 @@ class ManageMasterTest extends TestCase $this->loginAsUser(); $master = factory(Master::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters $this->patch(route('masters.update', $master), $this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -145,7 +145,7 @@ class ManageMasterTest extends TestCase $this->loginAsUser(); $master = factory(Master::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters $this->patch(route('masters.update', $master), $this->getEditFields([ 'description' => str_repeat('Long description', 16), ])); diff --git a/tests/Generators/Api/ApiFeatureTestGeneratorTest.php b/tests/Generators/Api/ApiFeatureTestGeneratorTest.php index 587e38b..dab17d1 100644 --- a/tests/Generators/Api/ApiFeatureTestGeneratorTest.php +++ b/tests/Generators/Api/ApiFeatureTestGeneratorTest.php @@ -75,7 +75,7 @@ class Manage{$this->model_name}Test extends TestCase { \$user = \$this->createUser(); - // Name empty + // name empty \$requestBody = \$this->getCreateFields(['name' => '']); \$this->postJson( route('api.{$this->table_name}.store'), @@ -92,7 +92,7 @@ class Manage{$this->model_name}Test extends TestCase { \$user = \$this->createUser(); - // Name 70 characters + // name 70 characters \$requestBody = \$this->getCreateFields(['name' => str_repeat('Test Title', 7)]); \$this->postJson( route('api.{$this->table_name}.store'), @@ -109,7 +109,7 @@ class Manage{$this->model_name}Test extends TestCase { \$user = \$this->createUser(); - // Description 256 characters + // description 256 characters \$requestBody = \$this->getCreateFields(['description' => str_repeat('Long description', 16)]); \$this->postJson( route('api.{$this->table_name}.store'), @@ -174,7 +174,7 @@ class Manage{$this->model_name}Test extends TestCase \$user = \$this->createUser(); \${$this->single_model_var_name} = factory(Vehicle::class)->create(); - // Name empty + // name empty \$requestBody = \$this->getEditFields(['name' => '']); \$this->patchJson( route('api.{$this->table_name}.update', \${$this->single_model_var_name}), @@ -192,7 +192,7 @@ class Manage{$this->model_name}Test extends TestCase \$user = \$this->createUser(); \${$this->single_model_var_name} = factory(Vehicle::class)->create(); - // Name 70 characters + // name 70 characters \$requestBody = \$this->getEditFields(['name' => str_repeat('Test Title', 7)]); \$this->patchJson( route('api.{$this->table_name}.update', \${$this->single_model_var_name}), @@ -210,7 +210,7 @@ class Manage{$this->model_name}Test extends TestCase \$user = \$this->createUser(); \${$this->single_model_var_name} = factory(Vehicle::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$requestBody = \$this->getEditFields(['description' => str_repeat('Long description', 16)]); \$this->patchJson( route('api.{$this->table_name}.update', \${$this->single_model_var_name}), @@ -320,7 +320,7 @@ class Manage{$this->model_name}Test extends TestCase { \$user = \$this->createUser(); - // Name empty + // name empty \$requestBody = \$this->getCreateFields(['name' => '']); \$this->postJson( route('api.{$this->table_name}.store'), @@ -337,7 +337,7 @@ class Manage{$this->model_name}Test extends TestCase { \$user = \$this->createUser(); - // Name 70 characters + // name 70 characters \$requestBody = \$this->getCreateFields(['name' => str_repeat('Test Title', 7)]); \$this->postJson( route('api.{$this->table_name}.store'), @@ -354,7 +354,7 @@ class Manage{$this->model_name}Test extends TestCase { \$user = \$this->createUser(); - // Description 256 characters + // description 256 characters \$requestBody = \$this->getCreateFields(['description' => str_repeat('Long description', 16)]); \$this->postJson( route('api.{$this->table_name}.store'), @@ -419,7 +419,7 @@ class Manage{$this->model_name}Test extends TestCase \$user = \$this->createUser(); \${$this->single_model_var_name} = factory(Vehicle::class)->create(); - // Name empty + // name empty \$requestBody = \$this->getEditFields(['name' => '']); \$this->patchJson( route('api.{$this->table_name}.update', \${$this->single_model_var_name}), @@ -437,7 +437,7 @@ class Manage{$this->model_name}Test extends TestCase \$user = \$this->createUser(); \${$this->single_model_var_name} = factory(Vehicle::class)->create(); - // Name 70 characters + // name 70 characters \$requestBody = \$this->getEditFields(['name' => str_repeat('Test Title', 7)]); \$this->patchJson( route('api.{$this->table_name}.update', \${$this->single_model_var_name}), @@ -455,7 +455,7 @@ class Manage{$this->model_name}Test extends TestCase \$user = \$this->createUser(); \${$this->single_model_var_name} = factory(Vehicle::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$requestBody = \$this->getEditFields(['description' => str_repeat('Long description', 16)]); \$this->patchJson( route('api.{$this->table_name}.update', \${$this->single_model_var_name}), diff --git a/tests/Generators/FeatureTestGeneratorTest.php b/tests/Generators/FeatureTestGeneratorTest.php index 8a9238f..00042e8 100644 --- a/tests/Generators/FeatureTestGeneratorTest.php +++ b/tests/Generators/FeatureTestGeneratorTest.php @@ -105,7 +105,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name empty + // name empty \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -115,7 +115,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name 70 characters + // name 70 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -127,7 +127,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Description 256 characters + // description 256 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -167,7 +167,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -178,7 +178,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -191,7 +191,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'description' => str_repeat('Long description', 16), ])); @@ -328,7 +328,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name empty + // name empty \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -338,7 +338,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name 70 characters + // name 70 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -350,7 +350,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Description 256 characters + // description 256 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -390,7 +390,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -401,7 +401,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -414,7 +414,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'description' => str_repeat('Long description', 16), ])); @@ -503,7 +503,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name empty + // name empty \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -513,7 +513,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name 70 characters + // name 70 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -525,7 +525,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Description 256 characters + // description 256 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -565,7 +565,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -576,7 +576,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -589,7 +589,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'description' => str_repeat('Long description', 16), ])); diff --git a/tests/Generators/Simple/FeatureTestGeneratorTest.php b/tests/Generators/Simple/FeatureTestGeneratorTest.php index ed1f68a..2d7b042 100644 --- a/tests/Generators/Simple/FeatureTestGeneratorTest.php +++ b/tests/Generators/Simple/FeatureTestGeneratorTest.php @@ -111,7 +111,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name empty + // name empty \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -121,7 +121,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name 70 characters + // name 70 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -133,7 +133,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Description 256 characters + // description 256 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -177,7 +177,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -188,7 +188,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -201,7 +201,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'description' => str_repeat('Long description', 16), ])); @@ -348,7 +348,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name empty + // name empty \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -358,7 +358,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Name 70 characters + // name 70 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -370,7 +370,7 @@ class Manage{$this->model_name}Test extends TestCase { \$this->loginAsUser(); - // Description 256 characters + // description 256 characters \$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ 'description' => str_repeat('Long description', 16), ])); @@ -414,7 +414,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name empty + // name empty \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); \$this->assertSessionHasErrors('name'); } @@ -425,7 +425,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Name 70 characters + // name 70 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'name' => str_repeat('Test Title', 7), ])); @@ -438,7 +438,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->loginAsUser(); \${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); - // Description 256 characters + // description 256 characters \$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ 'description' => str_repeat('Long description', 16), ]));