* Support php 5.3 for sql parser lib.

This commit is contained in:
qixinzhi
2023-02-10 11:24:24 +08:00
parent 7c2e937eda
commit 7c122a0b29
648 changed files with 13815 additions and 279048 deletions
@@ -1,7 +1,5 @@
<?php
declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tests\Builder;
use PhpMyAdmin\SqlParser\Parser;
@@ -9,9 +7,11 @@ use PhpMyAdmin\SqlParser\Tests\TestCase;
class ReplaceStatementTest extends TestCase
{
public function testBuilder(): void
public function testBuilder()
{
$parser = new Parser('REPLACE INTO tbl(col1, col2, col3) VALUES (1, "str", 3.14)');
$parser = new Parser(
'REPLACE INTO tbl(col1, col2, col3) VALUES (1, "str", 3.14)'
);
$stmt = $parser->statements[0];
$this->assertEquals(
'REPLACE INTO tbl(`col1`, `col2`, `col3`) VALUES (1, "str", 3.14)',
@@ -19,9 +19,11 @@ class ReplaceStatementTest extends TestCase
);
}
public function testBuilderSet(): void
public function testBuilderSet()
{
$parser = new Parser('REPLACE INTO tbl(col1, col2, col3) SET col1=1, col2="str", col3=3.14');
$parser = new Parser(
'REPLACE INTO tbl(col1, col2, col3) SET col1=1, col2="str", col3=3.14'
);
$stmt = $parser->statements[0];
$this->assertEquals(
'REPLACE INTO tbl(`col1`, `col2`, `col3`) SET col1 = 1, col2 = "str", col3 = 3.14',
@@ -29,9 +31,11 @@ class ReplaceStatementTest extends TestCase
);
}
public function testBuilderSelect(): void
public function testBuilderSelect()
{
$parser = new Parser('REPLACE INTO tbl(col1, col2, col3) SELECT col1, col2, col3 FROM tbl2');
$parser = new Parser(
'REPLACE INTO tbl(col1, col2, col3) SELECT col1, col2, col3 FROM tbl2'
);
$stmt = $parser->statements[0];
$this->assertEquals(
'REPLACE INTO tbl(`col1`, `col2`, `col3`) SELECT col1, col2, col3 FROM tbl2',
@@ -39,9 +43,11 @@ class ReplaceStatementTest extends TestCase
);
}
public function testBuilderSelectDelayed(): void
public function testBuilderSelectDelayed()
{
$parser = new Parser('REPLACE DELAYED INTO tbl(col1, col2, col3) SELECT col1, col2, col3 FROM tbl2');
$parser = new Parser(
'REPLACE DELAYED INTO tbl(col1, col2, col3) SELECT col1, col2, col3 FROM tbl2'
);
$stmt = $parser->statements[0];
$this->assertEquals(
'REPLACE DELAYED INTO tbl(`col1`, `col2`, `col3`) SELECT col1, col2, col3 FROM tbl2',