2016-09-21 13:42:40 +05:30
|
|
|
<?php
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace common\tests\unit\db\mysql;
|
2016-09-21 13:42:40 +05:30
|
|
|
|
|
|
|
use common\db\mysql\QueryBuilder;
|
2019-02-21 01:28:52 +05:30
|
|
|
use common\tests\unit\TestCase;
|
2016-09-21 13:42:40 +05:30
|
|
|
use Yii;
|
|
|
|
|
|
|
|
class QueryBuilderTest extends TestCase {
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
public function testBuildOrderByField(): void {
|
2016-09-21 13:42:40 +05:30
|
|
|
$queryBuilder = new QueryBuilder(Yii::$app->db);
|
|
|
|
$result = $queryBuilder->buildOrderBy(['dummy' => ['first', 'second']]);
|
2019-02-26 04:56:02 +05:30
|
|
|
$this->assertSame("ORDER BY FIELD(`dummy`,'first','second')", $result);
|
2016-09-21 13:42:40 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|