You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
668 B
30 lines
668 B
12 years ago
|
<?php
|
||
|
namespace yiiunit\framework\db\sqlite;
|
||
|
|
||
10 years ago
|
use yii\db\Query;
|
||
12 years ago
|
|
||
11 years ago
|
/**
|
||
|
* @group db
|
||
|
* @group sqlite
|
||
|
*/
|
||
8 years ago
|
class QueryTest extends \yiiunit\framework\db\QueryTest
|
||
12 years ago
|
{
|
||
11 years ago
|
protected $driverName = 'sqlite';
|
||
10 years ago
|
|
||
|
public function testUnion()
|
||
|
{
|
||
|
$connection = $this->getConnection();
|
||
|
$query = new Query;
|
||
|
$query->select(['id', 'name'])
|
||
|
->from('item')
|
||
|
->union(
|
||
|
(new Query())
|
||
|
->select(['id', 'name'])
|
||
|
->from(['category'])
|
||
|
);
|
||
|
$result = $query->all($connection);
|
||
|
$this->assertNotEmpty($result);
|
||
|
$this->assertSame(7, count($result));
|
||
|
}
|
||
12 years ago
|
}
|