summaryrefslogtreecommitdiffstats
path: root/tests/Components/ArrayObjTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Components/ArrayObjTest.php')
-rw-r--r--tests/Components/ArrayObjTest.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/tests/Components/ArrayObjTest.php b/tests/Components/ArrayObjTest.php
index 3664e1c..f683d72 100644
--- a/tests/Components/ArrayObjTest.php
+++ b/tests/Components/ArrayObjTest.php
@@ -1,8 +1,10 @@
<?php
+declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tests\Components;
use PhpMyAdmin\SqlParser\Components\ArrayObj;
+use PhpMyAdmin\SqlParser\Components\Expression;
use PhpMyAdmin\SqlParser\Parser;
use PhpMyAdmin\SqlParser\Tests\TestCase;
@@ -10,13 +12,13 @@ class ArrayObjTest extends TestCase
{
public function testBuildRaw()
{
- $component = new ArrayObj(array('a', 'b'), array());
+ $component = new ArrayObj(['a', 'b'], []);
$this->assertEquals('(a, b)', ArrayObj::build($component));
}
public function testBuildValues()
{
- $component = new ArrayObj(array(), array('a', 'b'));
+ $component = new ArrayObj([], ['a', 'b']);
$this->assertEquals('(a, b)', ArrayObj::build($component));
}
@@ -25,21 +27,23 @@ class ArrayObjTest extends TestCase
$components = ArrayObj::parse(
new Parser(),
$this->getTokensList('(1 + 2, 3 + 4)'),
- array(
- 'type' => 'PhpMyAdmin\\SqlParser\\Components\\Expression',
- 'typeOptions' => array(
+ [
+ 'type' => Expression::class,
+ 'typeOptions' => [
'breakOnParentheses' => true,
- )
- )
+ ],
+ ]
);
+ $this->assertInstanceOf(Expression::class, $components[0]);
+ $this->assertInstanceOf(Expression::class, $components[1]);
$this->assertEquals($components[0]->expr, '1 + 2');
$this->assertEquals($components[1]->expr, '3 + 4');
}
/**
- * @dataProvider parseProvider
- *
* @param mixed $test
+ *
+ * @dataProvider parseProvider
*/
public function testParse($test)
{
@@ -48,9 +52,9 @@ class ArrayObjTest extends TestCase
public function parseProvider()
{
- return array(
- array('parser/parseArrayErr1'),
- array('parser/parseArrayErr3')
- );
+ return [
+ ['parser/parseArrayErr1'],
+ ['parser/parseArrayErr3'],
+ ];
}
}