mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-16 15:21:13 +08:00

- changed test class naming for easier copying and searching of classes - made base tests abstract and made MySQL an equal citisen in the test hierarchie - added missing db specific test classes
30 lines
668 B
PHP
30 lines
668 B
PHP
<?php
|
|
namespace yiiunit\framework\db\sqlite;
|
|
|
|
use yii\db\Query;
|
|
|
|
/**
|
|
* @group db
|
|
* @group sqlite
|
|
*/
|
|
class QueryTest extends \yiiunit\framework\db\QueryTest
|
|
{
|
|
protected $driverName = 'sqlite';
|
|
|
|
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));
|
|
}
|
|
}
|