Skip to content

Commit 082a1fa

Browse files
committed
Add some missing assertions
Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 0735432 commit 082a1fa

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

tests/Components/Array2dTest.php

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,52 @@ public function testParseErr3()
4646
{
4747
$parser = new Parser();
4848
Array2d::parse($parser, $this->getTokensList(')'));
49-
Array2d::parse($parser, $this->getTokensList('TABLE'));
50-
// TODO: Assert errors.
49+
$this->assertEquals(
50+
1,
51+
count($parser->errors)
52+
);
53+
$this->assertEquals(
54+
'An opening bracket followed by a set of values was expected.',
55+
$parser->errors[0]->getMessage()
56+
);
5157
}
5258

5359
public function testParseErr4()
60+
{
61+
$parser = new Parser();
62+
Array2d::parse($parser, $this->getTokensList('TABLE'));
63+
$this->assertEquals(
64+
1,
65+
count($parser->errors)
66+
);
67+
$this->assertEquals(
68+
'An opening bracket followed by a set of values was expected.',
69+
$parser->errors[0]->getMessage()
70+
);
71+
}
72+
73+
public function testParseErr5()
5474
{
5575
$parser = new Parser();
5676
Array2d::parse($parser, $this->getTokensList('(1, 2),'));
77+
$this->assertEquals(
78+
1,
79+
count($parser->errors)
80+
);
5781
$this->assertEquals(
5882
"An opening bracket followed by a set of values was expected.",
5983
$parser->errors[0]->getMessage()
6084
);
6185
}
6286

63-
public function testParseErr5()
87+
public function testParseErr6()
6488
{
6589
$parser = new Parser();
6690
Array2d::parse($parser, $this->getTokensList('(1, 2),(3)'));
91+
$this->assertEquals(
92+
1,
93+
count($parser->errors)
94+
);
6795
$this->assertEquals(
6896
"2 values were expected, but found 1.",
6997
$parser->errors[0]->getMessage()

0 commit comments

Comments
 (0)