summaryrefslogtreecommitdiffstats
path: root/tests/Parser/ParserTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Parser/ParserTest.php')
-rw-r--r--tests/Parser/ParserTest.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php
index 57c4aae..cba4868 100644
--- a/tests/Parser/ParserTest.php
+++ b/tests/Parser/ParserTest.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Tests\Parser;
@@ -11,9 +12,9 @@ use PhpMyAdmin\SqlParser\TokensList;
class ParserTest extends TestCase
{
/**
- * @dataProvider parseProvider
- *
* @param mixed $test
+ *
+ * @dataProvider parseProvider
*/
public function testParse($test)
{
@@ -22,11 +23,11 @@ class ParserTest extends TestCase
public function parseProvider()
{
- return array(
- array('parser/parse'),
- array('parser/parse2'),
- array('parser/parseDelimiter')
- );
+ return [
+ ['parser/parse'],
+ ['parser/parse2'],
+ ['parser/parseDelimiter'],
+ ];
}
public function testUnrecognizedStatement()
@@ -60,20 +61,18 @@ class ParserTest extends TestCase
$this->assertEquals(
$parser->errors,
- array(
+ [
new ParserException('error #1', new Token('foo'), 1),
new ParserException('error #2', new Token('bar'), 2),
- )
+ ]
);
}
- /**
- * @expectedException \PhpMyAdmin\SqlParser\Exceptions\ParserException
- * @expectedExceptionMessage strict error
- * @expectedExceptionCode 3
- */
public function testErrorStrict()
{
+ $this->expectExceptionCode(3);
+ $this->expectExceptionMessage('strict error');
+ $this->expectException(ParserException::class);
$parser = new Parser(new TokensList());
$parser->strict = true;