ldc-arcadia-api/tests/Integration/Infra/Database/Models/IncoSheetModelTest.php
Jérémy Munsch 1d55dff5f4
feat(seeders): add IncoSheet and IncoCompo seeders
Implement seeders for IncoSheet and IncoCompo to populate the database with initial data.
2026-08-14 10:35:21 +02:00

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');
});
});