ldc-arcadia-api/tests/Integration/Database/Seeders/BrandSeederTest.php
Jérémy Munsch 1842223ddc
refactor(database): improve replicated factories, seeders, and config injection
- AbstractTableFactory delegates connection resolution without hardcoded config keys
- Enforce mandatory connection parameter on Migrator without Infra dependencies
- Inject ArcadiaStorageConfig, AppConfig, and HmacAuthConfig into services, seeders, and health checkers
- Enhance factories and seeders with helper methods (truncate, count, query, new)
- Clean up covers annotations on database seeders integration tests
2026-08-26 17:29:13 +02:00

32 lines
839 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Integration\Database\Seeders;
use Database\Seeders\BrandSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Infra\Database\Models\Brand;
use Tests\TestCase;
covers(Brand::class);
uses(TestCase::class, RefreshDatabase::class);
describe('BrandSeeder Integration Test', function (): void {
it('seeds default brand and arcadia brand records into the database', function (): void {
// GIVEN
$seeder = new BrandSeeder();
// WHEN
$seeder->run();
// THEN
expect(Brand::count())->toBe(12);
$brand = Brand::query()->where('uwil_public_id', 'LGL01')->first();
expect($brand)->not->toBeNull()
->and($brand?->arcadia_id->value)->toBe('1')
->and($brand?->name)->toBe('Le Gaulois');
});
});