ldc-arcadia-api/tests/Integration/Database/Seeders/IncoSheetSeederTest.php
Jérémy Munsch 152ee2b5a2
feat(api): add IncoSheets feature with DDD clean architecture, tests & OpenAPI spec
- Use cases: FindAllIncoSheets & FindIncoSheet (filters, pagination, short projection)
- Presentation: controllers, FormRequests with scalar validation, DTOs (camelCase)
- Ports & Adapters: IncoSheetDirectory & EloquentIncoSheetDirectory
- Tests: Pest 4 unit, integration, OpenAPI spectator conformance, dynamic arch tests
- Docs: updated Bruno collection and OpenAPI spec
2026-08-14 11:33:05 +02:00

30 lines
820 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Integration\Database\Seeders;
use Database\Seeders\IncoSheetSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Infra\Database\Models\IncoCompo;
use Infra\Database\Models\IncoSheet;
use Tests\TestCase;
covers(IncoSheet::class);
uses(TestCase::class, RefreshDatabase::class);
describe('IncoSheetSeeder Integration Test', function (): void {
it('seeds paired IncoSheet and IncoCompo entries including standalone sheets without compo', function (): void {
// GIVEN
$seeder = new IncoSheetSeeder();
// WHEN
$seeder->run();
// THEN
expect(IncoSheet::count())->toBe(4)
->and(IncoCompo::count())->toBe(3)
->and(IncoSheet::query()->whereNull('compo_id')->count())->toBe(1);
});
});