- 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
30 lines
820 B
PHP
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);
|
|
});
|
|
});
|