Skip to content

Commit 9ed34e0

Browse files
committed
- Support simple arrays like [1, 2, 3, 4, 5] as table-names which will result in a UNION-chain-subquery
1 parent 6dd59b6 commit 9ed34e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Builder/SelectTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ public function testParametrizedVirtualTables() {
394394

395395
public function testArrayTables() {
396396
$vt1 = TestSelect::create()
397-
->field('a.field1')
398-
->from('a', range(1, 9))->debug()
397+
->field('a.value')
398+
->from('a', range(1, 9))
399399
->asString();
400400

401-
$this->assertEquals("SELECT\n\ta.field1\nFROM\n\t(SELECT '1'\n\tUNION\n\tSELECT '2'\n\tUNION\n\tSELECT '3'\n\tUNION\n\tSELECT '4'\n\tUNION\n\tSELECT '5'\n\tUNION\n\tSELECT '6'\n\tUNION\n\tSELECT '7'\n\tUNION\n\tSELECT '8'\n\tUNION\n\tSELECT '9') a\n", $vt1);
401+
$this->assertEquals("SELECT\n\ta.value\nFROM\n\t(SELECT '1' AS `value`\n\tUNION\n\tSELECT '2' AS `value`\n\tUNION\n\tSELECT '3' AS `value`\n\tUNION\n\tSELECT '4' AS `value`\n\tUNION\n\tSELECT '5' AS `value`\n\tUNION\n\tSELECT '6' AS `value`\n\tUNION\n\tSELECT '7' AS `value`\n\tUNION\n\tSELECT '8' AS `value`\n\tUNION\n\tSELECT '9' AS `value`) a\n", $vt1);
402402
}
403403
}

0 commit comments

Comments
 (0)