summaryrefslogtreecommitdiffstats
path: root/tests/Utils/QueryTest.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-25 14:19:28 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-25 14:19:28 +0300
commit6e335616597277d0687bd036fc9acc05386369a0 (patch)
treea8ee43ace199160a54eceb04f0f26fa25117d42d /tests/Utils/QueryTest.php
parentfc390a8d2af884f5f81dd313687046932a833b2e (diff)
downloadsql-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.php15
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()