Skip to content

Commit 4ad634b

Browse files
committed
Fix #260 - Update test data
Signed-off-by: William Desportes <[email protected]>
1 parent 32e10ad commit 4ad634b

11 files changed

Lines changed: 31 additions & 24 deletions

tests/Builder/UpdateStatementTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ public function testBuilder(): void
1717
);
1818
$stmt = $parser->statements[0];
1919
$this->assertEquals(
20-
'UPDATE user AS `u` SET ud.ip = \'33\' WHERE u.id = 1',
20+
'UPDATE user AS `u` LEFT JOIN user_detail AS `ud` ON u.id = ud.user_id SET ud.ip = \'33\' WHERE u.id = 1',
2121
$stmt->build()
2222
);
2323
/* Assertion 2 */
2424
$parser = new Parser('update user u join user_detail ud on u.id = ud.user_id set ud.ip =\'33\' where u.id = 1');
2525
$stmt = $parser->statements[0];
2626
$this->assertEquals(
27-
'UPDATE user AS `u` SET ud.ip = \'33\' WHERE u.id = 1',
27+
'UPDATE user AS `u` JOIN user_detail AS `ud` ON u.id = ud.user_id SET ud.ip = \'33\' WHERE u.id = 1',
2828
$stmt->build()
2929
);
3030
/* Assertion 3 */
@@ -33,7 +33,7 @@ public function testBuilder(): void
3333
);
3434
$stmt = $parser->statements[0];
3535
$this->assertEquals(
36-
'UPDATE user AS `u` SET ud.ip = \'33\' WHERE u.id = 1',
36+
'UPDATE user AS `u` INNER JOIN user_detail AS `ud` ON u.id = ud.user_id SET ud.ip = \'33\' WHERE u.id = 1',
3737
$stmt->build()
3838
);
3939
}

tests/data/parser/parseTransaction.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@
502502
],
503503
"order": null,
504504
"limit": null,
505+
"join": null,
505506
"options": {
506507
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
507508
"options": []

tests/data/parser/parseTransaction2.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@
502502
],
503503
"order": null,
504504
"limit": null,
505+
"join": null,
505506
"options": {
506507
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
507508
"options": []

tests/data/parser/parseUpdate1.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
"where": null,
215215
"order": null,
216216
"limit": null,
217+
"join": null,
217218
"options": {
218219
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
219220
"options": []

tests/data/parser/parseUpdate2.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@
372372
"offset": 2,
373373
"rowCount": 1
374374
},
375+
"join": null,
375376
"options": {
376377
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
377378
"options": []

tests/data/parser/parseUpdate3.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
],
222222
"order": null,
223223
"limit": null,
224+
"join": null,
224225
"options": {
225226
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
226227
"options": []

tests/data/parser/parseUpdate4.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@
357357
],
358358
"order": null,
359359
"limit": null,
360+
"join": null,
360361
"options": {
361362
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
362363
"options": []

tests/data/parser/parseUpdate5.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,6 @@
444444
],
445445
"order": null,
446446
"limit": null,
447-
"options": {
448-
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
449-
"options": []
450-
},
451-
"first": 0,
452-
"last": 41,
453447
"join": [
454448
{
455449
"@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword",
@@ -479,7 +473,13 @@
479473
],
480474
"using": null
481475
}
482-
]
476+
],
477+
"options": {
478+
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
479+
"options": []
480+
},
481+
"first": 0,
482+
"last": 41
483483
}
484484
],
485485
"brackets": 0,

tests/data/parser/parseUpdate6.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,6 @@
625625
],
626626
"order": null,
627627
"limit": null,
628-
"options": {
629-
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
630-
"options": []
631-
},
632-
"first": 0,
633-
"last": 60,
634628
"join": [
635629
{
636630
"@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword",
@@ -686,7 +680,13 @@
686680
],
687681
"using": null
688682
}
689-
]
683+
],
684+
"options": {
685+
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
686+
"options": []
687+
},
688+
"first": 0,
689+
"last": 60
690690
}
691691
],
692692
"brackets": 0,

tests/data/parser/parseUpdate7.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,6 @@
625625
],
626626
"order": null,
627627
"limit": null,
628-
"options": {
629-
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
630-
"options": []
631-
},
632-
"first": 0,
633-
"last": 60,
634628
"join": [
635629
{
636630
"@type": "PhpMyAdmin\\SqlParser\\Components\\JoinKeyword",
@@ -686,7 +680,13 @@
686680
],
687681
"using": null
688682
}
689-
]
683+
],
684+
"options": {
685+
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
686+
"options": []
687+
},
688+
"first": 0,
689+
"last": 60
690690
}
691691
],
692692
"brackets": 0,

0 commit comments

Comments
 (0)