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.php29
1 files changed, 15 insertions, 14 deletions
diff --git a/tests/Components/ExpressionTest.php b/tests/Components/ExpressionTest.php
index bb4b8fc..914ca31 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,7 +22,7 @@ class ExpressionTest extends TestCase
}
/**
- * @dataProvider testParseErrProvider
+ * @dataProvider parseErrProvider
*
* @param mixed $expr
* @param mixed $error
@@ -34,40 +35,40 @@ class ExpressionTest extends TestCase
$this->assertEquals($errors[0][0], $error);
}
- public function testParseErrProvider()
+ 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'),
- );
+ ];
$this->assertEquals(
Expression::build($component),
'1 + 2 AS `three`, 1 + 3 AS `four`'