17
17
use Doctrine \DBAL \Query \QueryBuilder ;
18
18
use Doctrine \DBAL \Schema \AbstractSchemaManager ;
19
19
use Doctrine \DBAL \Schema \SchemaConfig ;
20
- use Doctrine \DBAL \Schema \Synchronizer \SchemaSynchronizer ;
21
20
use Doctrine \DBAL \Statement ;
22
21
use PHPUnit \Framework \TestCase ;
23
22
use Symfony \Component \Messenger \Tests \Fixtures \DummyMessage ;
@@ -29,7 +28,6 @@ public function testGetAMessageWillChangeItsStatus()
29
28
{
30
29
$ queryBuilder = $ this ->getQueryBuilderMock ();
31
30
$ driverConnection = $ this ->getDBALConnectionMock ();
32
- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
33
31
$ stmt = $ this ->getResultMock ([
34
32
'id ' => 1 ,
35
33
'body ' => '{"message":"Hi"} ' ,
@@ -52,7 +50,7 @@ public function testGetAMessageWillChangeItsStatus()
52
50
->method ('executeQuery ' )
53
51
->willReturn ($ stmt );
54
52
55
- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
53
+ $ connection = new Connection ([], $ driverConnection );
56
54
$ doctrineEnvelope = $ connection ->get ();
57
55
$ this ->assertEquals (1 , $ doctrineEnvelope ['id ' ]);
58
56
$ this ->assertEquals ('{"message":"Hi"} ' , $ doctrineEnvelope ['body ' ]);
@@ -63,7 +61,6 @@ public function testGetWithNoPendingMessageWillReturnNull()
63
61
{
64
62
$ queryBuilder = $ this ->getQueryBuilderMock ();
65
63
10000
$ driverConnection = $ this ->getDBALConnectionMock ();
66
- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
67
64
$ stmt = $ this ->getResultMock (false );
68
65
69
66
$ queryBuilder
@@ -81,7 +78,7 @@ public function testGetWithNoPendingMessageWillReturnNull()
81
78
->method ('executeQuery ' )
82
79
->willReturn ($ stmt );
83
80
84
- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
81
+ $ connection = new Connection ([], $ driverConnection );
85
82
$ doctrineEnvelope = $ connection ->get ();
86
83
$ this ->assertNull ($ doctrineEnvelope );
87
84
}
@@ -154,11 +151,6 @@ private function getResultMock($expectedResult)
154
151
return $ stmt ;
155
152
}
156
153
157
- private function getSchemaSynchronizerMock (): SchemaSynchronizer
158
- {
159
- return $ this ->createMock (SchemaSynchronizer::class);
160
- }
161
-
162
154
/**
163
155
* @dataProvider buildConfigurationProvider
164
156
*/
@@ -261,7 +253,6 @@ public function testFind()
261
253
{
262
254
$ queryBuilder = $ this ->getQueryBuilderMock ();
263
255
$ driverConnection = $ this ->getDBALConnectionMock ();
264
- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
265
256
$ id = 1 ;
266
257
$ stmt = $ this ->getResultMock ([
267
258
'id ' => $ id ,
@@ -285,7 +276,7 @@ public function testFind()
285
276
->method ('executeQuery ' )
286
277
->willReturn ($ stmt );
287
278
288
- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
279
+ $ connection = new Connection ([], $ driverConnection );
289
280
$ doctrineEnvelope = $ connection ->find ($ id );
290
281
$ this ->assertEquals (1 , $ doctrineEnvelope ['id ' ]);
291
282
$ this ->assertEquals ('{"message":"Hi"} ' , $ doctrineEnvelope ['body ' ]);
@@ -296,7 +287,6 @@ public function testFindAll()
296
287
{
297
288
$ queryBuilder = $ this ->getQueryBuilderMock ();
298
289
$ driverConnection = $ this ->getDBALConnectionMock ();
299
- $ schemaSynchronizer = $ this ->getSchemaSynchronizerMock ();
300
290
$ message1 = [
301
291
'id ' => 1 ,
302
292
'body ' => '{"message":"Hi"} ' ,
@@ -332,7 +322,7 @@ public function testFindAll()
332
322
->method ('executeQuery ' )
333
323
->willReturn ($ stmt );
334
324
335
- $ connection = new Connection ([], $ driverConnection, $ schemaSynchronizer );
325
+ $ connection = new Connection ([], $ driverConnection );
336
326
$ doctrineEnvelopes = $ connection ->findAll ();
337
327
338
328
$ this ->assertEquals (1 , $ doctrineEnvelopes [0 ]['id ' ]);
0 commit comments