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()
108108 $ platform = $ this ->getMockBuilder (AbstractPlatform::class)
109109 ->getMock ();
110110 $ platform ->method ('getWriteLockSQL ' )->willReturn ('FOR UPDATE ' );
111+ $ configuration = $ this ->getMockBuilder (\Doctrine \DBAL \Configuration::class)
112+ ->getMock ();
111113 $ driverConnection ->method ('getDatabasePlatform ' )->willReturn ($ platform );
114+ $ driverConnection ->method ('getConfiguration ' )->willReturn ($ configuration );
112115
113116 return $ driverConnection ;
114117 }
Original file line number Diff line number Diff line change @@ -197,7 +197,25 @@ public function reject(string $id): bool
197197
198198 public function setup (): void
199199 {
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+
200212 $ 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+ }
201219 }
202220
203221 public function getMessageCount (): int
You can’t perform that action at this time.
0 commit comments