@@ -184,7 +184,12 @@ public function testGenerateFromEmptySchema(): void
184184 self ::assertSame ('path2 ' , $ this ->migrationDiffGenerator ->generate ('2345 ' , null , false , 120 , true , true ));
185185 }
186186
187- public function testGenerateAppliesFilterOnMappedSchema (): void
187+ /**
188+ * @param array<int, string> $expectedTables
189+ *
190+ * @dataProvider getGenerateAppliesFilterOnMappedSchemaData
191+ */
192+ public function testGenerateAppliesFilterOnMappedSchema (bool $ platformSupportsSchemas , array $ expectedTables ): void
188193 {
189194 // a standard Regex SchemaAssetsFilter already registered on the DBAL
190195 $ dbalSchemaAssetsFilter = static function ($ assetName ): bool {
@@ -197,6 +202,10 @@ public function testGenerateAppliesFilterOnMappedSchema(): void
197202 $ toTable2 = new Table ('some_schema.table2 ' );
198203 $ toSchema = new Schema ([$ toTable1 , $ toTable2 ]);
199204
205+ $ this ->platform ->expects (self ::atLeast (1 ))
206+ ->method ('supportsSchemas ' )
207+ ->willReturn ($ platformSupportsSchemas );
208+
200209 $ this ->schemaManager ->expects (self ::once ())
201210 ->method ('introspectSchema ' )
202211 ->willReturn ($ fromSchema );
@@ -224,7 +233,16 @@ public function testGenerateAppliesFilterOnMappedSchema(): void
224233
225234 $ filteredTableNames = array_map (static fn (Table $ table ) => $ table ->getName (), $ toSchema ->getTables ());
226235
227- self ::assertSame (['some_schema.table1 ' , 'some_schema.table2 ' ], array_values ($ filteredTableNames ));
236+ self ::assertSame ($ expectedTables , array_values ($ filteredTableNames ));
237+ }
238+
239+ /** @return array<string, array<int, bool|array<int, string>>> */
240+ public static function getGenerateAppliesFilterOnMappedSchemaData (): array
241+ {
242+ return [
243+ 'platform without schemas supports ' => [false , []],
244+ 'platform with schema schemas support ' => [true , ['some_schema.table1 ' , 'some_schema.table2 ' ]],
245+ ];
228246 }
229247
230248 protected function setUp (): void
0 commit comments