diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-07-25 14:19:28 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-07-25 14:19:28 +0300 |
commit | 6e335616597277d0687bd036fc9acc05386369a0 (patch) | |
tree | a8ee43ace199160a54eceb04f0f26fa25117d42d /tests/Utils/QueryTest.php | |
parent | fc390a8d2af884f5f81dd313687046932a833b2e (diff) | |
download | sql-parser-6e335616597277d0687bd036fc9acc05386369a0.zip sql-parser-6e335616597277d0687bd036fc9acc05386369a0.tar.gz sql-parser-6e335616597277d0687bd036fc9acc05386369a0.tar.bz2 |
Improved support for UNION.
Diffstat (limited to 'tests/Utils/QueryTest.php')
-rw-r--r-- | tests/Utils/QueryTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Utils/QueryTest.php b/tests/Utils/QueryTest.php index c3a2f28..8dd2323 100644 --- a/tests/Utils/QueryTest.php +++ b/tests/Utils/QueryTest.php @@ -385,6 +385,21 @@ class QueryTest extends TestCase 'WHERE film_id > 0' ) ); + + $parser = new Parser( + 'select supplier.city, supplier.id from supplier ' + . 'union select customer.city, customer.id from customer' + ); + $this->assertEquals( + 'select supplier.city, supplier.id from supplier ' + . 'union select customer.city, customer.id from customer' + . ' ORDER BY city ', + Query::replaceClause( + $parser->statements[0], + $parser->list, + 'ORDER BY city' + ) + ); } public function testReplaceClauseOnlyKeyword() |