2016-09-21 11:12:40 +03:00
|
|
|
<?php
|
2019-02-20 22:58:52 +03:00
|
|
|
namespace common\tests\unit\db\mysql;
|
2016-09-21 11:12:40 +03:00
|
|
|
|
|
|
|
use common\db\mysql\QueryBuilder;
|
2019-02-20 22:58:52 +03:00
|
|
|
use common\tests\unit\TestCase;
|
2016-09-21 11:12:40 +03:00
|
|
|
use Yii;
|
|
|
|
|
|
|
|
class QueryBuilderTest extends TestCase {
|
|
|
|
|
|
|
|
public function testBuildOrderByField() {
|
|
|
|
$queryBuilder = new QueryBuilder(Yii::$app->db);
|
|
|
|
$result = $queryBuilder->buildOrderBy(['dummy' => ['first', 'second']]);
|
2019-02-26 02:26:02 +03:00
|
|
|
$this->assertSame("ORDER BY FIELD(`dummy`,'first','second')", $result);
|
2016-09-21 11:12:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|