* Support php 5.3 for sql parser lib.
This commit is contained in:
+14
-10
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\SqlParser\Tests\Components;
|
||||
|
||||
use PhpMyAdmin\SqlParser\Components\ExpressionArray;
|
||||
@@ -10,28 +8,32 @@ use PhpMyAdmin\SqlParser\Tests\TestCase;
|
||||
|
||||
class ExpressionArrayTest extends TestCase
|
||||
{
|
||||
public function testParse(): void
|
||||
public function testParse()
|
||||
{
|
||||
$component = ExpressionArray::parse(
|
||||
new Parser(),
|
||||
$this->getTokensList('(expr)'),
|
||||
['breakOnParentheses' => true]
|
||||
array(
|
||||
'breakOnParentheses' => true
|
||||
)
|
||||
);
|
||||
$this->assertEquals([], $component);
|
||||
$this->assertEquals(array(), $component);
|
||||
}
|
||||
|
||||
public function testParse2(): void
|
||||
public function testParse2()
|
||||
{
|
||||
$component = ExpressionArray::parse(
|
||||
new Parser(),
|
||||
$this->getTokensList('(expr) +'),
|
||||
['parenthesesDelimited' => true]
|
||||
array(
|
||||
'parenthesesDelimited' => true
|
||||
)
|
||||
);
|
||||
$this->assertCount(1, $component);
|
||||
$this->assertEquals('(expr)', $component[0]->expr);
|
||||
}
|
||||
|
||||
public function testParseWithCommentsNoOptions(): void
|
||||
public function testParseWithCommentsNoOptions()
|
||||
{
|
||||
$component = ExpressionArray::parse(
|
||||
new Parser(),
|
||||
@@ -41,12 +43,14 @@ class ExpressionArrayTest extends TestCase
|
||||
$this->assertEquals('(expr)', $component[0]->expr);
|
||||
}
|
||||
|
||||
public function testParseWithCommentsAndOptions(): void
|
||||
public function testParseWithCommentsAndOptions()
|
||||
{
|
||||
$component = ExpressionArray::parse(
|
||||
new Parser(),
|
||||
$this->getTokensList('(expr -- comment ?)'),
|
||||
['parenthesesDelimited' => true]
|
||||
array(
|
||||
'parenthesesDelimited' => true
|
||||
)
|
||||
);
|
||||
$this->assertCount(1, $component);
|
||||
$this->assertEquals('(expr', $component[0]->expr);
|
||||
|
||||
Reference in New Issue
Block a user