@@ -248,22 +248,22 @@ public function testUnionSelectEmptyTable()
248248 $ this ->assertSame ($ result ->getErrorMessage (), 'Empty $table in QueryBuilder::unionSelect ' );
249249 }
250250
251- public function testUnionSelectIncorrectTable ()
251+ public function testUnionSelectAllMethodEmptyTable ()
252252 {
253- $ result = $ this ->qb ->select ('clients ' , ['name ' , 'age ' ])->unionSelect ( 2 );
253+ $ result = $ this ->qb ->select ('clients ' , ['name ' , 'age ' ])->unionSelectAll ( '' );
254254
255255 $ this ->assertSame ($ this ->qb , $ result );
256256 $ this ->assertSame (true , $ result ->hasError ());
257- $ this ->assertSame ($ result ->getErrorMessage (), 'Incorrect type of $table in QueryBuilder::unionSelect. $table must be a string or an array ' );
257+ $ this ->assertSame ($ result ->getErrorMessage (), 'Empty $table in QueryBuilder::unionSelectAll ' );
258258 }
259259
260- public function testUnionSelectDoubleUnion ()
260+ public function testUnionSelectIncorrectTable ()
261261 {
262- $ result = $ this ->qb ->select ('clients ' , ['name ' , 'age ' ])->union ()-> unionSelect (' clients ' );
262+ $ result = $ this ->qb ->select ('clients ' , ['name ' , 'age ' ])->unionSelect (2 );
263263
264264 $ this ->assertSame ($ this ->qb , $ result );
265265 $ this ->assertSame (true , $ result ->hasError ());
266- $ this ->assertSame ($ result ->getErrorMessage (), 'SQL has already UNION in QueryBuilder::unionSelect ' );
266+ $ this ->assertSame ($ result ->getErrorMessage (), 'Incorrect type of $table in QueryBuilder::unionSelect. $table must be a string or an array ' );
267267 }
268268
269269 public function testUnionSelectWhere ()
@@ -288,6 +288,17 @@ public function testUnionAllSelectWhere()
288288 $ this ->assertSame ([10 ], $ result ->getParams ());
289289 }
290290
291+ public function testUnionSelectAllMethodWhere ()
292+ {
293+ $ result = $ this ->qb ->select ('cabs ' , ['id ' , 'name ' ])
294+ ->unionSelectAll ('printer_models ' )->where ([['id ' , '< ' , 10 ]]);
295+
296+ $ this ->assertSame ($ this ->qb , $ result );
297+ $ this ->assertSame (false , $ result ->hasError ());
298+ $ this ->assertSame ("SELECT `id`, `name` FROM `cabs` UNION ALL SELECT `id`, `name` FROM `printer_models` WHERE (`id` < 10) " , $ result ->getSql ());
299+ $ this ->assertSame ([10 ], $ result ->getParams ());
300+ }
301+
291302 public function testSelectExceptsWhere ()
292303 {
293304 $ result = $ this ->qb ->select ('contacts ' , ['contact_id ' , 'last_name ' , 'first_name ' ])
0 commit comments