summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Components/Array2dTest.php34
-rw-r--r--tests/Utils/FormatterTest.php6
2 files changed, 37 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()
);
diff --git a/tests/Utils/FormatterTest.php b/tests/Utils/FormatterTest.php
index 1cc3b06..f8a911f 100644
--- a/tests/Utils/FormatterTest.php
+++ b/tests/Utils/FormatterTest.php
@@ -59,6 +59,9 @@ class FormatTest extends TestCase
array(
'type' => 0,
'flags' => 0,
+ 'html' => '',
+ 'cli' => '',
+ 'function' => '',
),
),
array( // overriding
@@ -69,6 +72,9 @@ class FormatTest extends TestCase
array(
'type' => 0,
'flags' => 0,
+ 'html' => '',
+ 'cli' => '',
+ 'function' => '',
),
),
),