@@ -539,6 +539,39 @@ public function testOverlapsConditionOperator(Closure|iterable|ExpressionInterfa
539539 $ this ->assertSame ( $ expectedCount, $ count);
540540 }
541541
542+ public function testArrayOverlapsWithExpressionColumnParams(): void
543+ {
544+ $ db = $ this ->getSharedConnection ();
545+ $ qb = $ db ->getQueryBuilder ();
546+ $ params = [];
547+
548+ $ sql = $ qb ->buildExpression (
549+ new ArrayOverlaps(new Expression('array_remove(column, :empty)', [':empty' => null]), [1, 2, 3]),
550+ $ params,
551+ );
552+
553+ $ this ->assertSame ('array_remove(column, :empty)::int[] && ARRAY[1,2,3]::int[]', $ sql);
554+ $ this ->assertSame ([':empty' => null], $ params);
555+ }
556+
557+ public function testJsonOverlapsWithExpressionColumnParams(): void
558+ {
559+ $ db = $ this ->getSharedConnection ();
560+ $ qb = $ db ->getQueryBuilder ();
561+ $ params = [];
562+
563+ $ sql = $ qb ->buildExpression (
564+ new JsonOverlaps(new Expression('jsonb_path_query_array(column, :path)', [':path' => '$[*]']), [1, 2, 3]),
565+ $ params,
566+ );
567+
568+ $ this ->assertSame (
569+ 'ARRAY(SELECT jsonb_array_elements_text(jsonb_path_query_array(column, :path)::jsonb))::int[] && ARRAY[1,2,3]::int[]',
570+ $ sql,
571+ );
572+ $ this ->assertSame ([':path' => '$[*]'], $ params);
573+ }
574+
542575 #[DataProviderExternal(QueryBuilderProvider::class, 'buildColumnDefinition')]
543576 public function testBuildColumnDefinition(string $ expected, Closure|ColumnInterface|string $ column): void
544577 {
0 commit comments