File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ private function getDBALConnectionMock()
108
108
$ platform = $ this ->getMockBuilder (AbstractPlatform::class)
109
109
->getMock ();
110
110
$ platform ->method ('getWriteLockSQL ' )->willReturn ('FOR UPDATE ' );
111
+ $ configuration = $ this ->getMockBuilder (\Doctrine \DBAL \Configuration::class)
112
+ ->getMock ();
111
113
$ driverConnection ->method ('getDatabasePlatform ' )->willReturn ($ platform );
114
+ $ driverConnection ->method ('getConfiguration ' )->willReturn ($ configuration );
112
115
113
116
return $ driverConnection ;
114
117
}
Original file line number Diff line number Diff line change @@ -197,7 +197,25 @@ public function reject(string $id): bool
197
197
198
198
public function setup (): void
199
199
{
200
+ $ configuration = $ this ->driverConnection ->getConfiguration ();
201
+ // Since Doctrine 2.9 the getFilterSchemaAssetsExpression is deprecated
202
+ $ hasFilterCallback = method_exists ($ configuration , 'getSchemaAssetsFilter ' );
203
+
204
+ if ($ hasFilterCallback ) {
205
+ $ assetFilter = $ this ->driverConnection ->getConfiguration ()->getSchemaAssetsFilter ();
206
+ $ this ->driverConnection ->getConfiguration ()->setSchemaAssetsFilter (null );
207
+ } else {
208
+ $ assetFilter = $ this ->driverConnection ->getConfiguration ()->getFilterSchemaAssetsExpression ();
209
+ $ this ->driverConnection ->getConfiguration ()->setFilterSchemaAssetsExpression (null );
210
+ }
211
+
200
212
$ this ->schemaSynchronizer ->updateSchema ($ this ->getSchema (), true );
213
+
214
+ if ($ hasFilterCallback ) {
215
+ $ this ->driverConnection ->getConfiguration ()->setSchemaAssetsFilter ($ assetFilter );
216
+ } else {
217
+ $ this ->driverConnection ->getConfiguration ()->setFilterSchemaAssetsExpression ($ assetFilter );
218
+ }
201
219
}
202
220
203
221
public function getMessageCount (): int
You can’t perform that action at this time.
0 commit comments