Complete TP7 TP8 authentication authorization and classic CSS
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\Product;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -13,6 +14,8 @@ class ValidationTp5Test extends TestCase
|
||||
|
||||
public function test_client_creation_rejects_invalid_values_and_keeps_old_input(): void
|
||||
{
|
||||
$this->actingAs(User::factory()->create());
|
||||
|
||||
$this->from(route('clients.create'))->post(route('clients.store'), [
|
||||
'name' => '',
|
||||
'email' => 'bonjour',
|
||||
@@ -35,6 +38,8 @@ class ValidationTp5Test extends TestCase
|
||||
|
||||
public function test_client_limits_optional_fields_and_update_validation(): void
|
||||
{
|
||||
$this->actingAs(User::factory()->create());
|
||||
|
||||
$valid = ['name' => 'Jean Dupont', 'email' => 'jean@example.test'];
|
||||
$this->post(route('clients.store'), $valid)->assertRedirect(route('clients.index'));
|
||||
$client = Client::firstOrFail();
|
||||
@@ -76,6 +81,8 @@ class ValidationTp5Test extends TestCase
|
||||
|
||||
public function test_product_creation_and_update_reject_invalid_values(): void
|
||||
{
|
||||
$this->actingAs(User::factory()->create());
|
||||
|
||||
foreach ([
|
||||
['name' => '', 'price' => 15, 'stock' => 10, 'field' => 'name'],
|
||||
['name' => 'Clavier', 'price' => -10, 'stock' => 10, 'field' => 'price'],
|
||||
|
||||
Reference in New Issue
Block a user