summaryrefslogtreecommitdiffstats
path: root/tests/Components/ExpressionArrayTest.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-19 14:36:53 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-19 14:36:53 +0300
commit5e554b3534c44f122906fea36ef7698a5769316b (patch)
tree4cd766c505b0f93498eccc6d75f9446b21f6a5a4 /tests/Components/ExpressionArrayTest.php
parentb894375c04eb138f4c541623e644be8364ff11de (diff)
downloadsql-parser-5e554b3534c44f122906fea36ef7698a5769316b.zip
sql-parser-5e554b3534c44f122906fea36ef7698a5769316b.tar.gz
sql-parser-5e554b3534c44f122906fea36ef7698a5769316b.tar.bz2
Avoid processing the alias twice and generate an error.
Errors are triggered when an unexpected token is found between clauses. Refactoring.
Diffstat (limited to 'tests/Components/ExpressionArrayTest.php')
-rw-r--r--tests/Components/ExpressionArrayTest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/Components/ExpressionArrayTest.php b/tests/Components/ExpressionArrayTest.php
index ea772e3..0fad913 100644
--- a/tests/Components/ExpressionArrayTest.php
+++ b/tests/Components/ExpressionArrayTest.php
@@ -21,4 +21,17 @@ class ExpressionArrayTest extends TestCase
);
$this->assertEquals(array(), $component);
}
+
+ public function testParse2()
+ {
+ $component = ExpressionArray::parse(
+ new Parser(),
+ $this->getTokensList('(expr) +'),
+ array(
+ 'bracketsDelimited' => true,
+ )
+ );
+ $this->assertEquals(1, count($component));
+ $this->assertEquals('(expr)', $component[0]->expr);
+ }
}