summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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()
);