Browse Source

Update validation field name comment on test

tags/1.2.9
Nafies Luthfi 7 years ago
parent
commit
63a0cfd3d8
  1. 12
      src/stubs/testcases/feature/api.stub
  2. 12
      src/stubs/testcases/feature/full.stub
  3. 12
      src/stubs/testcases/feature/simple.stub
  4. 24
      tests/Generators/Api/ApiFeatureTestGeneratorTest.php
  5. 36
      tests/Generators/FeatureTestGeneratorTest.php
  6. 24
      tests/Generators/Simple/FeatureTestGeneratorTest.php

12
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),

12
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),
]));

12
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),
]));

24
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}),

36
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),
]));

24
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),
]));

Loading…
Cancel
Save