Files
yii2/tests/framework/db/sqlite/QueryTest.php
Carsten Brandt 8ba032d147 refactored database tests
- 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
2016-06-20 19:26:43 +02:00

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));
}
}