diff options
author | Michal Čihař <michal@cihar.com> | 2017-01-03 13:41:21 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2017-01-03 13:41:21 +0100 |
commit | 082a1fad6c64f455ac42698cb9c7a08f0347a2c0 (patch) | |
tree | f1082dc071d8fefc12fae57c65e5356cfbe4386f /tests | |
parent | 0735432a80ceade3518ec13c1ba0814c7118f66e (diff) | |
download | sql-parser-082a1fad6c64f455ac42698cb9c7a08f0347a2c0.zip sql-parser-082a1fad6c64f455ac42698cb9c7a08f0347a2c0.tar.gz sql-parser-082a1fad6c64f455ac42698cb9c7a08f0347a2c0.tar.bz2 |
Add some missing assertions
Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Components/Array2dTest.php | 34 |
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() ); |