@@ -184,7 +184,12 @@ public function testGenerateFromEmptySchema(): void
184
184
self ::assertSame ('path2 ' , $ this ->migrationDiffGenerator ->generate ('2345 ' , null , false , 120 , true , true ));
185
185
}
186
186
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
188
193
{
189
194
// a standard Regex SchemaAssetsFilter already registered on the DBAL
190
195
$ dbalSchemaAssetsFilter = static function ($ assetName ): bool {
@@ -197,6 +202,10 @@ public function testGenerateAppliesFilterOnMappedSchema(): void
197
202
$ toTable2 = new Table ('some_schema.table2 ' );
198
203
$ toSchema = new Schema ([$ toTable1 , $ toTable2 ]);
199
204
205
+ $ this ->platform ->expects (self ::atLeast (1 ))
206
+ ->method ('supportsSchemas ' )
207
+ ->willReturn ($ platformSupportsSchemas );
208
+
200
209
$ this ->schemaManager ->expects (self ::once ())
201
210
->method ('introspectSchema ' )
202
211
->willReturn ($ fromSchema );
@@ -224,7 +233,16 @@ public function testGenerateAppliesFilterOnMappedSchema(): void
224
233
225
234
$ filteredTableNames = array_map (static fn (Table $ table ) => $ table ->getName (), $ toSchema ->getTables ());
226
235
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
+ ];
228
246
}
229
247
230
248
protected function setUp (): void
0 commit comments