Implement seeders for IncoSheet and IncoCompo to populate the database with initial data.
30 lines
803 B
PHP
30 lines
803 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Integration\Infra\Database\Models;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Infra\Database\Models\IncoSheet;
|
|
use Tests\TestCase;
|
|
|
|
covers(IncoSheet::class);
|
|
|
|
uses(TestCase::class, RefreshDatabase::class);
|
|
|
|
describe('IncoSheet Eloquent Model & Factory', function (): void {
|
|
it('creates and persists an IncoSheet record via factory', function (): void {
|
|
// GIVEN
|
|
$sheet = IncoSheet::factory()->create([
|
|
'name' => 'Poulet Rôti 1kg Test',
|
|
]);
|
|
|
|
// WHEN
|
|
$retrieved = IncoSheet::find($sheet->id);
|
|
|
|
// THEN
|
|
expect($retrieved)->not->toBeNull()
|
|
->and($retrieved->id)->toBe($sheet->id)
|
|
->and($retrieved->name)->toBe('Poulet Rôti 1kg Test');
|
|
});
|
|
});
|