1818use Doctrine \DBAL \Schema \AbstractSchemaManager ;
1919use Doctrine \DBAL \Schema \Schema ;
2020use Doctrine \DBAL \Schema \SchemaConfig ;
21- use Doctrine \DBAL \Schema \Synchronizer \SchemaSynchronizer ;
2221use Doctrine \DBAL \Statement ;
2322use PHPUnit \Framework \TestCase ;
2423use Symfony \Component \Messenger \Bridge \Doctrine \Tests \Fixtures \DummyMessage ;
@@ -30,7 +29,6 @@ public function testGetAMessageWillChangeItsStatus()
3029 {
3130 $ queryBuilder = $ this ->getQueryBuilderMock ();
3231 $ driverConnection = $ this ->getDBALConnectionMock ();
33- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
3432 $ stmt = $ this ->getResultMock ([
3533 'id ' => 1 ,
3634 'body ' => '{"message":"Hi"} ' ,
@@ -53,7 +51,7 @@ public function testGetAMessageWillChangeItsStatus()
5351 ->method ('executeQuery ' )
5452 ->willReturn ($ stmt );
5553
56- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
54+ $ connection = new Connection ([], $ driverConnection );
5755 $ doctrineEnvelope = $ connection ->get ();
5856 $ this ->assertEquals (1 , $ doctrineEnvelope ['id ' ]);
5957 $ this ->assertEquals ('{"message":"Hi"} ' , $ doctrineEnvelope ['body ' ]);
@@ -64,7 +62,6 @@ public function testGetWithNoPendingMessageWillReturnNull()
6462 {
6563 $ queryBuilder = $ this ->getQueryBuilderMock ();
6664 $ driverConnection = $ this ->getDBALConnectionMock ();
67- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
6865 $ stmt = $ this ->getResultMock (false );
6966
7067 $ queryBuilder
@@ -82,7 +79,7 @@ public function testGetWithNoPendingMessageWillReturnNull()
8279 ->method ('executeQuery ' )
8380 ->willReturn ($ stmt );
8481
85- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
82+ $ connection = new Connection ([], $ driverConnection );
8683 $ doctrineEnvelope = $ connection ->get ();
8784 $ this ->assertNull ($ doctrineEnvelope );
8885 }
@@ -155,11 +152,6 @@ private function getResultMock($expectedResult)
155152 return $ stmt ;
156153 }
157154
158- private function getSchemaSynchronizerMock (): SchemaSynchronizer
159- {
160- return $ this ->createMock (SchemaSynchronizer::class);
161- }
162-
163155 /**
164156 * @dataProvider buildConfigurationProvider
165157 */
@@ -264,7 +256,6 @@ public function testFind()
264256 {
265257 $ queryBuilder = $ this ->getQueryBuilderMock ();
266258 $ driverConnection = $ this ->getDBALConnectionMock ();
267- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
268259 $ id = 1 ;
269260 $ stmt = $ this ->getResultMock ([
270261 'id ' => $ id ,
@@ -288,7 +279,7 @@ public function testFind()
288279 ->method ('executeQuery ' )
289280 ->willReturn ($ stmt );
290281
291- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
282+ $ connection = new Connection ([], $ driverConnection );
292283 $ doctrineEnvelope = $ connection ->find ($ id );
293284 $ this ->assertEquals (1 , $ doctrineEnvelope ['id ' ]);
294285 $ this ->assertEquals ('{"message":"Hi"} ' , $ doctrineEnvelope ['body ' ]);
@@ -299,7 +290,6 @@ public function testFindAll()
299290 {
300291 $ queryBuilder = $ this ->getQueryBuilderMock ();
301292 $ driverConnection = $ this ->getDBALConnectionMock ();
302- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
303293 $ message1 = [
304294 'id ' => 1 ,
305295 'body ' => '{"message":"Hi"} ' ,
@@ -335,7 +325,7 @@ public function testFindAll()
335325 ->method ('executeQuery ' )
336326 ->willReturn ($ stmt );
337327
338- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
328+ $ connection = new Connection ([], $ driverConnection );
339329 $ doctrineEnvelopes = $ connection ->findAll ();
340330
341331 $ this ->assertEquals (1 , $ doctrineEnvelopes [0 ]['id ' ]);
0 commit comments