summaryrefslogtreecommitdiffstats
path: root/tests/Components/Array2dTest.php
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2017-01-03 14:19:14 +0100
committerMichal Čihař <michal@cihar.com>2017-01-03 14:19:14 +0100
commite704f6be7968c047285962bb6735134333c68cf8 (patch)
tree0f4b9eaadf0ecee738c2b9a8b6c9bb1d8f97bcff /tests/Components/Array2dTest.php
parenteb2b165784d31bb51bb5d2b364d61ce8c6bfea27 (diff)
parent082a1fad6c64f455ac42698cb9c7a08f0347a2c0 (diff)
downloadsql-parser-e704f6be7968c047285962bb6735134333c68cf8.zip
sql-parser-e704f6be7968c047285962bb6735134333c68cf8.tar.gz
sql-parser-e704f6be7968c047285962bb6735134333c68cf8.tar.bz2
Merge branch 'master' into motranslator
Diffstat (limited to 'tests/Components/Array2dTest.php')
-rw-r--r--tests/Components/Array2dTest.php34
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/Components/Array2dTest.php b/tests/Components/Array2dTest.php
index a1c9786..ee9d679 100644
--- a/tests/Components/Array2dTest.php
+++ b/tests/Components/Array2dTest.php
@@ -46,25 +46,53 @@ class Array2dTest extends TestCase
{
$parser = new Parser();
Array2d::parse($parser, $this->getTokensList(')'));
- Array2d::parse($parser, $this->getTokensList('TABLE'));
- // TODO: Assert errors.
+ $this->assertEquals(
+ 1,
+ count($parser->errors)
+ );
+ $this->assertEquals(
+ 'An opening bracket followed by a set of values was expected.',
+ $parser->errors[0]->getMessage()
+ );
}
public function testParseErr4()
{
$parser = new Parser();
+ Array2d::parse($parser, $this->getTokensList('TABLE'));
+ $this->assertEquals(
+ 1,
+ count($parser->errors)
+ );
+ $this->assertEquals(
+ 'An opening bracket followed by a set of values was expected.',
+ $parser->errors[0]->getMessage()
+ );
+ }
+
+ public function testParseErr5()
+ {
+ $parser = new Parser();
Array2d::parse($parser, $this->getTokensList('(1, 2),'));
$this->assertEquals(
+ 1,
+ count($parser->errors)
+ );
+ $this->assertEquals(
"An opening bracket followed by a set of values was expected.",
$parser->errors[0]->getMessage()
);
}
- public function testParseErr5()
+ public function testParseErr6()
{
$parser = new Parser();
Array2d::parse($parser, $this->getTokensList('(1, 2),(3)'));
$this->assertEquals(
+ 1,
+ count($parser->errors)
+ );
+ $this->assertEquals(
"2 values were expected, but found 1.",
$parser->errors[0]->getMessage()
);