Skip to content

Commit

Permalink
Test column as Expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jun 30, 2024
1 parent fe600bf commit a897572
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Yiisoft\Db\Exception\InvalidArgumentException;
use Yiisoft\Db\Exception\InvalidConfigException;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Expression\Expression;
use Yiisoft\Db\Expression\ExpressionInterface;
use Yiisoft\Db\Mysql\Tests\Support\TestTrait;
use Yiisoft\Db\Query\Query;
Expand Down Expand Up @@ -679,6 +680,13 @@ public function testJsonOverlapsConditionBuilder(): void
$this->assertSame('JSON_OVERLAPS(`column`, :qp0)', $sql);
$this->assertSame([':qp0' => '[1,2,3]'], $params);

// Test column as Expression
$params = [];
$sql = $qb->buildExpression(new JsonOverlapsCondition(new Expression('column'), [1, 2, 3]), $params);

$this->assertSame('JSON_OVERLAPS(column, :qp0)', $sql);
$this->assertSame([':qp0' => '[1,2,3]'], $params);

$db->close();
}

Expand Down

0 comments on commit a897572

Please sign in to comment.