|
|
@ -101,19 +101,31 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function create_{$this->lang_name}_action_must_pass_validations() |
|
|
|
|
|
|
|
|
public function validate_{$this->lang_name}_name_is_required() |
|
|
{ |
|
|
{ |
|
|
\$this->loginAsUser(); |
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Name empty
|
|
|
// Name empty
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_name_is_not_more_than_60_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Name 70 characters
|
|
|
// Name 70 characters
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
])); |
|
|
])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_description_is_not_more_than_255_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Description 256 characters
|
|
|
// Description 256 characters
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
@ -150,7 +162,7 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function edit_{$this->lang_name}_action_must_pass_validations() |
|
|
|
|
|
|
|
|
public function validate_{$this->lang_name}_name_update_is_required() |
|
|
{ |
|
|
{ |
|
|
\$this->loginAsUser(); |
|
|
\$this->loginAsUser(); |
|
|
\${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); |
|
|
\${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); |
|
|
@ -158,12 +170,26 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
// Name empty
|
|
|
// Name empty
|
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_name_update_is_not_more_than_60_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$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([ |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
])); |
|
|
])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_description_update_is_not_more_than_255_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$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([ |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ |
|
|
@ -298,19 +324,31 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function create_{$this->lang_name}_action_must_pass_validations() |
|
|
|
|
|
|
|
|
public function validate_{$this->lang_name}_name_is_required() |
|
|
{ |
|
|
{ |
|
|
\$this->loginAsUser(); |
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Name empty
|
|
|
// Name empty
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_name_is_not_more_than_60_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Name 70 characters
|
|
|
// Name 70 characters
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
])); |
|
|
])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_description_is_not_more_than_255_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Description 256 characters
|
|
|
// Description 256 characters
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
@ -347,7 +385,7 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function edit_{$this->lang_name}_action_must_pass_validations() |
|
|
|
|
|
|
|
|
public function validate_{$this->lang_name}_name_update_is_required() |
|
|
{ |
|
|
{ |
|
|
\$this->loginAsUser(); |
|
|
\$this->loginAsUser(); |
|
|
\${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); |
|
|
\${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); |
|
|
@ -355,12 +393,26 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
// Name empty
|
|
|
// Name empty
|
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_name_update_is_not_more_than_60_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$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([ |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
])); |
|
|
])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_description_update_is_not_more_than_255_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$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([ |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ |
|
|
@ -447,19 +499,31 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function create_{$this->lang_name}_action_must_pass_validations() |
|
|
|
|
|
|
|
|
public function validate_{$this->lang_name}_name_is_required() |
|
|
{ |
|
|
{ |
|
|
\$this->loginAsUser(); |
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Name empty
|
|
|
// Name empty
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields(['name' => ''])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_name_is_not_more_than_60_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Name 70 characters
|
|
|
// Name 70 characters
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
])); |
|
|
])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_description_is_not_more_than_255_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$this->loginAsUser(); |
|
|
|
|
|
|
|
|
// Description 256 characters
|
|
|
// Description 256 characters
|
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
\$this->post(route('{$this->table_name}.store'), \$this->getCreateFields([ |
|
|
@ -496,7 +560,7 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** @test */ |
|
|
/** @test */ |
|
|
public function edit_{$this->lang_name}_action_must_pass_validations() |
|
|
|
|
|
|
|
|
public function validate_{$this->lang_name}_name_update_is_required() |
|
|
{ |
|
|
{ |
|
|
\$this->loginAsUser(); |
|
|
\$this->loginAsUser(); |
|
|
\${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); |
|
|
\${$this->lang_name} = factory({$this->model_name}::class)->create(['name' => 'Testing 123']); |
|
|
@ -504,12 +568,26 @@ class Manage{$this->model_name}Test extends TestCase |
|
|
// Name empty
|
|
|
// Name empty
|
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields(['name' => ''])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_name_update_is_not_more_than_60_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$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([ |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
'name' => str_repeat('Test Title', 7), |
|
|
])); |
|
|
])); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
\$this->assertSessionHasErrors('name'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @test */ |
|
|
|
|
|
public function validate_{$this->lang_name}_description_update_is_not_more_than_255_characters() |
|
|
|
|
|
{ |
|
|
|
|
|
\$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([ |
|
|
\$this->patch(route('{$this->table_name}.update', \${$this->lang_name}), \$this->getEditFields([ |
|
|
|