max('id') ?? 0); app(SyntheticSeeder::class)->seed( table: $table, count: 5, requiredColumns: ['created_at'], ); $rows = DB::table($table)->where('id', '>', $maxId)->get(['id', 'created_at']); $this->assertCount(5, $rows, '합성 행 5건이 삽입되어야 합니다.'); $this->assertSame( 0, $rows->whereNull('created_at')->count(), '정렬 기준 컬럼(created_at)이 NULL 인 합성 행이 있으면 계측이 동률로 무너집니다.' ); $this->assertGreaterThan( 1, $rows->pluck('created_at')->unique()->count(), '정렬 기준 컬럼 값이 행마다 분산되어야 합니다(전부 같은 값이면 filesort 가 지배).' ); } /** * 요구 컬럼을 지정하지 않으면 기존 동작(NOT NULL 컬럼만 채움)이 유지되는지 검증합니다. */ #[Test] public function it_keeps_existing_behaviour_without_required_columns(): void { $table = 'users'; $maxId = (int) (DB::table($table)->max('id') ?? 0); app(SyntheticSeeder::class)->seed(table: $table, count: 3); $this->assertSame( 3, DB::table($table)->where('id', '>', $maxId)->count(), '요구 컬럼 없이도 시딩 자체는 동작해야 합니다.' ); } }