* Update sqlparser to fit php8.

This commit is contained in:
songchenxuan
2024-03-20 09:10:47 +08:00
committed by liyang
parent 380f1d530b
commit f297325727
663 changed files with 140347 additions and 16174 deletions
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tests\Builder;
use PhpMyAdmin\SqlParser\Parser;
@@ -7,11 +9,9 @@ use PhpMyAdmin\SqlParser\Tests\TestCase;
class ReplaceStatementTest extends TestCase
{
public function testBuilder()
public function testBuilder(): void
{
$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,11 +19,9 @@ class ReplaceStatementTest extends TestCase
);
}
public function testBuilderSet()
public function testBuilderSet(): void
{
$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',
@@ -31,11 +29,9 @@ class ReplaceStatementTest extends TestCase
);
}
public function testBuilderSelect()
public function testBuilderSelect(): void
{
$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',
@@ -43,11 +39,9 @@ class ReplaceStatementTest extends TestCase
);
}
public function testBuilderSelectDelayed()
public function testBuilderSelectDelayed(): void
{
$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',