2026-08-20 17:35:42 +02:00
|
|
|
<?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;
|
|
|
|
|
|
2026-08-26 17:29:13 +02:00
|
|
|
covers(Brand::class);
|
2026-08-20 17:35:42 +02:00
|
|
|
|
|
|
|
|
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
|
2026-08-26 17:29:13 +02:00
|
|
|
expect(Brand::count())->toBe(12);
|
2026-08-20 17:35:42 +02:00
|
|
|
|
|
|
|
|
$brand = Brand::query()->where('uwil_public_id', 'LGL01')->first();
|
|
|
|
|
expect($brand)->not->toBeNull()
|
2026-08-24 21:45:04 +02:00
|
|
|
->and($brand?->arcadia_id->value)->toBe('1')
|
2026-08-21 11:27:32 +02:00
|
|
|
->and($brand?->name)->toBe('Le Gaulois');
|
2026-08-20 17:35:42 +02:00
|
|
|
});
|
|
|
|
|
});
|