Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions tests/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,46 @@ public function testUnion()
$this->assertSameSql($expect, $actual);
}

public function testMultipleUnion()
{
$this->query->columns('c1')
->from('t1')
->union()
->columns('c2')
->from('t2')
->union()
->columns('c3')
->from('t3')
->union()
->columns('c4')
->from('t4');

$expect = '
SELECT
c1
FROM
t1
UNION
SELECT
c2
FROM
t2
UNION
SELECT
c3
FROM
t3
UNION
SELECT
c4
FROM
t4
';

$actual = $this->query->getStatement();
$this->assertSameSql($expect, $actual);
}

public function testUnionAll()
{
$this->query->columns('c1')
Expand Down