summaryrefslogtreecommitdiffstats
path: root/tests/Fragments/WhereKeywordTest.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-07 02:00:28 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-07 02:43:41 +0300
commite58d23067743641529348e4a1cc93cf1c73a85a5 (patch)
tree1098e75ffaa6e0d84a4c400217ec62e6c4a923d4 /tests/Fragments/WhereKeywordTest.php
parent06c0a645e9d19b1f899c3883ae9b11e5c50bc31e (diff)
downloadsql-parser-e58d23067743641529348e4a1cc93cf1c73a85a5.zip
sql-parser-e58d23067743641529348e4a1cc93cf1c73a85a5.tar.gz
sql-parser-e58d23067743641529348e4a1cc93cf1c73a85a5.tar.bz2
Improved fragments. New builders available. Refactored some fields.
New query utility to extract the name of the tables used in a statement. TRUNCATE is being parsed now. CREATE parsing and building has been improved. Improved the definition of UPDATE and DELETE statements. Fixed coding style. Improved documentation and tests.
Diffstat (limited to 'tests/Fragments/WhereKeywordTest.php')
-rw-r--r--tests/Fragments/WhereKeywordTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/Fragments/WhereKeywordTest.php b/tests/Fragments/WhereKeywordTest.php
index e125cf0..ded3a80 100644
--- a/tests/Fragments/WhereKeywordTest.php
+++ b/tests/Fragments/WhereKeywordTest.php
@@ -15,4 +15,12 @@ class WhereKeywordTest extends TestCase
$fragment = WhereKeyword::parse(new Parser(), $this->getTokensList('/* id = */ id = 10'));
$this->assertEquals($fragment[0]->expr, 'id = 10');
}
+
+ public function testParseBetween()
+ {
+ $fragment = WhereKeyword::parse(new Parser(), $this->getTokensList('(id BETWEEN 10 AND 20) OR (id BETWEEN 30 AND 40)'));
+ $this->assertEquals($fragment[0]->expr, '(id BETWEEN 10 AND 20)');
+ $this->assertEquals($fragment[1]->expr, 'OR');
+ $this->assertEquals($fragment[2]->expr, '(id BETWEEN 30 AND 40)');
+ }
}