@@ -30,7 +30,7 @@ public function shouldGetDeleteEvent(): void
30
30
'INSERT INTO test (data) VALUES( \'Hello World \') '
31
31
);
32
32
33
- $ this ->connection ->exec ('DELETE FROM test WHERE id = 1 ' );
33
+ $ this ->connection ->executeStatement ('DELETE FROM test WHERE id = 1 ' );
34
34
35
35
self ::assertInstanceOf (XidDTO::class, $ this ->getEvent ());
36
36
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
@@ -53,7 +53,7 @@ public function shouldGetUpdateEvent(): void
53
53
'INSERT INTO test (data) VALUES( \'Hello \') '
54
54
);
55
55
56
- $ this ->connection ->exec ('UPDATE test SET data = \'World \', id = 2 WHERE id = 1 ' );
56
+ $ this ->connection ->executeStatement ('UPDATE test SET data = \'World \', id = 2 WHERE id = 1 ' );
57
57
58
58
self ::assertInstanceOf (XidDTO::class, $ this ->getEvent ());
59
59
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
@@ -73,9 +73,9 @@ public function shouldGetUpdateEvent(): void
73
73
*/
74
74
public function shouldGetWriteEventDropTable (): void
75
75
{
76
- $ this ->connection ->exec ($ createExpected = 'CREATE TABLE `test` (id INTEGER(11)) ' );
77
- $ this ->connection ->exec ('INSERT INTO `test` VALUES (1) ' );
78
- $ this ->connection ->exec ($ dropExpected = 'DROP TABLE `test` ' );
76
+ $ this ->connection ->executeStatement ($ createExpected = 'CREATE TABLE `test` (id INTEGER(11)) ' );
77
+ $ this ->connection ->executeStatement ('INSERT INTO `test` VALUES (1) ' );
78
+ $ this ->connection ->executeStatement ($ dropExpected = 'DROP TABLE `test` ' );
79
79
80
80
/** @var QueryDTO $event */
81
81
$ event = $ this ->getEvent ();
@@ -101,15 +101,15 @@ public function shouldGetWriteEventDropTable(): void
101
101
/** @var QueryDTO $event */
102
102
$ event = $ this ->getEvent ();
103
103
self ::assertInstanceOf (QueryDTO::class, $ event );
104
- self ::assertContains ($ dropExpected , $ event ->getQuery ());
104
+ self ::assertStringContainsString ($ dropExpected , $ event ->getQuery ());
105
105
}
106
106
107
107
/**
108
108
* @test
109
109
*/
110
110
public function shouldGetQueryEventCreateTable (): void
111
111
{
112
- $ this ->connection ->exec (
112
+ $ this ->connection ->executeStatement (
113
113
$ createExpected = 'CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id)) '
114
114
);
115
115
@@ -132,10 +132,10 @@ public function shouldDropColumn(): void
132
132
133
133
$ this ->connect ();
134
134
135
- $ this ->connection ->exec ('CREATE TABLE test_drop_column (id INTEGER(11), data VARCHAR(50)) ' );
136
- $ this ->connection ->exec ('INSERT INTO test_drop_column VALUES (1, \'A value \') ' );
137
- $ this ->connection ->exec ('ALTER TABLE test_drop_column DROP COLUMN data ' );
138
- $ this ->connection ->exec ('INSERT INTO test_drop_column VALUES (2) ' );
135
+ $ this ->connection ->executeStatement ('CREATE TABLE test_drop_column (id INTEGER(11), data VARCHAR(50)) ' );
136
+ $ this ->connection ->executeStatement ('INSERT INTO test_drop_column VALUES (1, \'A value \') ' );
137
+ $ this ->connection ->executeStatement ('ALTER TABLE test_drop_column DROP COLUMN data ' );
138
+ $ this ->connection ->executeStatement ('INSERT INTO test_drop_column VALUES (2) ' );
139
139
140
140
/** @var WriteRowsDTO $event */
141
141
$ event = $ this ->getEvent ();
@@ -161,7 +161,7 @@ public function shouldFilterEvents(): void
161
161
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
162
162
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
163
163
164
- $ this ->connection ->exec ($ createTableExpected = 'CREATE TABLE test (id INTEGER(11), data VARCHAR(50)) ' );
164
+ $ this ->connection ->executeStatement ($ createTableExpected = 'CREATE TABLE test (id INTEGER(11), data VARCHAR(50)) ' );
165
165
166
166
/** @var QueryDTO $event */
167
167
$ event = $ this ->getEvent ();
@@ -186,19 +186,19 @@ public function shouldFilterTables(): void
186
186
187
187
$ this ->connect ();
188
188
189
- $ this ->connection ->exec (
189
+ $ this ->connection ->executeStatement (
190
190
'CREATE TABLE test_2 (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id)) '
191
191
);
192
- $ this ->connection ->exec (
192
+ $ this ->connection ->executeStatement (
193
193
'CREATE TABLE test_3 (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id)) '
194
194
);
195
- $ this ->connection ->exec (
195
+ $ this ->connection ->executeStatement (
196
196
'CREATE TABLE test_4 (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id)) '
197
197
);
198
198
199
- $ this ->connection ->exec ('INSERT INTO test_4 (data) VALUES ( \'foo \') ' );
200
- $ this ->connection ->exec ('INSERT INTO test_3 (data) VALUES ( \'bar \') ' );
201
- $ this ->connection ->exec ('INSERT INTO test_2 (data) VALUES ( \'' . $ expectedValue . '\') ' );
199
+ $ this ->connection ->executeStatement ('INSERT INTO test_4 (data) VALUES ( \'foo \') ' );
200
+ $ this ->connection ->executeStatement ('INSERT INTO test_3 (data) VALUES ( \'bar \') ' );
201
+ $ this ->connection ->executeStatement ('INSERT INTO test_2 (data) VALUES ( \'' . $ expectedValue . '\') ' );
202
202
203
203
$ event = $ this ->getEvent ();
204
204
self ::assertInstanceOf (WriteRowsDTO::class, $ event );
@@ -222,9 +222,9 @@ public function shouldTruncateTable(): void
222
222
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
223
223
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
224
224
225
- $ this ->connection ->exec ('CREATE TABLE test_truncate_column (id INTEGER(11), data VARCHAR(50)) ' );
226
- $ this ->connection ->exec ('INSERT INTO test_truncate_column VALUES (1, \'A value \') ' );
227
- $ this ->connection ->exec ('TRUNCATE TABLE test_truncate_column ' );
225
+ $ this ->connection ->executeStatement ('CREATE TABLE test_truncate_column (id INTEGER(11), data VARCHAR(50)) ' );
226
+ $ this ->connection ->executeStatement ('INSERT INTO test_truncate_column VALUES (1, \'A value \') ' );
227
+ $ this ->connection ->executeStatement ('TRUNCATE TABLE test_truncate_column ' );
228
228
229
229
$ event = $ this ->getEvent ();
230
230
self ::assertSame ('CREATE TABLE test_truncate_column (id INTEGER(11), data VARCHAR(50)) ' , $ event ->getQuery ());
@@ -250,7 +250,7 @@ public function shouldJsonSetPartialUpdateWithHoles(): void
250
250
251
251
$ this ->createAndInsertValue ($ create_query , $ insert_query );
252
252
253
- $ this ->connection ->exec ('UPDATE t1 SET j = JSON_SET(j, \'$.addr.detail.ab \', \'970785C8 \') ' );
253
+ $ this ->connection ->executeStatementuteStatement ('UPDATE t1 SET j = JSON_SET(j, \'$.addr.detail.ab \', \'970785C8 \') ' );
254
254
255
255
self ::assertInstanceOf (XidDTO::class, $ this ->getEvent ());
256
256
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
@@ -286,7 +286,7 @@ public function shouldJsonRemovePartialUpdateWithHoles(): void
286
286
287
287
$ this ->createAndInsertValue ($ create_query , $ insert_query );
288
288
289
- $ this ->connection ->exec ('UPDATE t1 SET j = JSON_REMOVE(j, \'$.addr.detail.ab \') ' );
289
+ $ this ->connection ->executeStatement ('UPDATE t1 SET j = JSON_REMOVE(j, \'$.addr.detail.ab \') ' );
290
290
291
291
self ::assertInstanceOf (XidDTO::class, $ this ->getEvent ());
292
292
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
@@ -322,7 +322,7 @@ public function shouldJsonReplacePartialUpdateWithHoles(): void
322
322
323
323
$ this ->createAndInsertValue ($ create_query , $ insert_query );
324
324
325
- $ this ->connection ->exec ('UPDATE t1 SET j = JSON_REPLACE(j, \'$.addr.detail.ab \', \'9707 \') ' );
325
+ $ this ->connection ->executeStatement ('UPDATE t1 SET j = JSON_REPLACE(j, \'$.addr.detail.ab \', \'9707 \') ' );
326
326
327
327
self ::assertInstanceOf (XidDTO::class, $ this ->getEvent ());
328
328
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
@@ -347,11 +347,11 @@ public function shouldJsonReplacePartialUpdateWithHoles(): void
347
347
*/
348
348
public function shouldRoteLog (): void
349
349
{
350
- $ this ->connection ->exec ('FLUSH LOGS ' );
350
+ $ this ->connection ->executeStatement ('FLUSH LOGS ' );
351
351
352
352
self ::assertInstanceOf (RotateDTO::class, $ this ->getEvent ());
353
353
354
- self ::assertRegExp (
354
+ self ::assertMatchesRegularExpression (
355
355
'/^[a-z-]+\.[\d]+$/ ' ,
356
356
$ this ->getEvent ()->getEventInfo ()->getBinLogCurrent ()->getBinFileName ()
357
357
);
@@ -371,7 +371,7 @@ public function shouldUseProvidedEventDispatcher(): void
371
371
372
372
$ this ->connectWithProvidedEventDispatcher ($ eventDispatcher );
373
373
374
- $ this ->connection ->exec (
374
+ $ this ->connection ->executeStatement (
375
375
$ createExpected = 'CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id)) '
376
376
);
377
377
@@ -392,14 +392,14 @@ private function connectWithProvidedEventDispatcher(EventDispatcherInterface $ev
392
392
393
393
$ this ->connection = $ this ->mySQLReplicationFactory ->getDbConnection ();
394
394
395
- $ this ->connection ->exec ('SET SESSION time_zone = "UTC" ' );
396
- $ this ->connection ->exec ('DROP DATABASE IF EXISTS ' . $ this ->database );
397
- $ this ->connection ->exec ('CREATE DATABASE ' . $ this ->database );
398
- $ this ->connection ->exec ('USE ' . $ this ->database );
399
- $ this ->connection ->exec ('SET SESSION sql_mode = \'\'; ' );
395
+ $ this ->connection ->executeStatement ('SET SESSION time_zone = "UTC" ' );
396
+ $ this ->connection ->executeStatement ('DROP DATABASE IF EXISTS ' . $ this ->database );
397
+ $ this ->connection ->executeStatement ('CREATE DATABASE ' . $ this ->database );
398
+ $ this ->connection ->executeStatement ('USE ' . $ this ->database );
399
+ $ this ->connection ->executeStatement ('SET SESSION sql_mode = \'\'; ' );
400
400
401
401
self ::assertInstanceOf (FormatDescriptionEventDTO::class, $ this ->getEvent ());
402
402
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
403
403
self ::assertInstanceOf (QueryDTO::class, $ this ->getEvent ());
404
404
}
405
- }
405
+ }
0 commit comments