summaryrefslogtreecommitdiffstats
path: root/tests/Components/ExpressionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Components/ExpressionTest.php')
-rw-r--r--tests/Components/ExpressionTest.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/Components/ExpressionTest.php b/tests/Components/ExpressionTest.php
index 45b8be5..f56384c 100644
--- a/tests/Components/ExpressionTest.php
+++ b/tests/Components/ExpressionTest.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tests\Components;
@@ -21,10 +22,10 @@ class ExpressionTest extends TestCase
}
/**
- * @dataProvider parseErrProvider
- *
* @param mixed $expr
* @param mixed $error
+ *
+ * @dataProvider parseErrProvider
*/
public function testParseErr($expr, $error)
{
@@ -36,38 +37,38 @@ class ExpressionTest extends TestCase
public function parseErrProvider()
{
- return array(
+ return [
/*
array(
'(1))',
'Unexpected closing bracket.',
),
*/
- array(
+ [
'tbl..col',
'Unexpected dot.',
- ),
- array(
+ ],
+ [
'id AS AS id2',
'An alias was expected.',
- ),
- array(
+ ],
+ [
'id`id2`\'id3\'',
'An alias was previously found.',
- ),
- array(
+ ],
+ [
'(id) id2 id3',
'An alias was previously found.',
- )
- );
+ ],
+ ];
}
public function testBuild()
{
- $component = array(
+ $component = [
new Expression('1 + 2', 'three'),
- new Expression('1 + 3', 'four')
- );
+ new Expression('1 + 3', 'four'),
+ ];
$this->assertEquals(
Expression::build($component),
'1 + 2 AS `three`, 1 + 3 AS `four`'