Skip to content

Commit a767f4a

Browse files
committed
Update tests according changes in db
1 parent e405c73 commit a767f4a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

tests/Provider/QueryBuilderProvider.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -623,31 +623,31 @@ public static function multiOperandFunctionBuilder(): array
623623
$stringParam = new Param('{3,4,5}', DataType::STRING);
624624

625625
$data['Longest with 3 operands'][1][1] = $stringQuery;
626-
$data['Longest with 3 operands'][2] = "(SELECT value FROM (SELECT 'short' AS value UNION SELECT $stringQuerySql"
627-
. ' AS value UNION SELECT :qp0 AS value) AS t ORDER BY LENGTH(value) DESC LIMIT 1)';
626+
$data['Longest with 3 operands'][2] = "(SELECT value FROM (SELECT :qp0 AS value UNION SELECT $stringQuerySql"
627+
. ' AS value UNION SELECT :qp1 AS value) AS t ORDER BY LENGTH(value) DESC LIMIT 1)';
628628
$data['Shortest with 3 operands'][1][1] = $stringQuery;
629-
$data['Shortest with 3 operands'][2] = "(SELECT value FROM (SELECT 'short' AS value UNION SELECT $stringQuerySql"
630-
. ' AS value UNION SELECT :qp0 AS value) AS t ORDER BY LENGTH(value) ASC LIMIT 1)';
629+
$data['Shortest with 3 operands'][2] = "(SELECT value FROM (SELECT :qp0 AS value UNION SELECT $stringQuerySql"
630+
. ' AS value UNION SELECT :qp1 AS value) AS t ORDER BY LENGTH(value) ASC LIMIT 1)';
631631

632632
return [
633633
...$data,
634634
'ArrayMerge with 1 operand' => [
635635
ArrayMerge::class,
636-
['ARRAY[1,2,3]'],
637-
'(ARRAY[1,2,3])',
636+
[[1, 2, 3]],
637+
'(ARRAY[1,2,3]::int[])',
638638
[1, 2, 3],
639639
],
640640
'ArrayMerge with 2 operands' => [
641641
ArrayMerge::class,
642-
['ARRAY[1,2,3]', $stringParam],
643-
'ARRAY(SELECT DISTINCT UNNEST(ARRAY[1,2,3] || :qp0))',
642+
[[1, 2, 3], $stringParam],
643+
'ARRAY(SELECT DISTINCT UNNEST(ARRAY[1,2,3]::int[] || :qp0))',
644644
[1, 2, 3, 4, 5],
645645
[':qp0' => $stringParam],
646646
],
647647
'ArrayMerge with 4 operands' => [
648648
ArrayMerge::class,
649-
['ARRAY[1,2,3]', [5, 6, 7], $stringParam, self::getDb()->select(new ArrayValue([9, 10]))],
650-
'ARRAY(SELECT DISTINCT UNNEST(ARRAY[1,2,3] || ARRAY[5,6,7]::int[] || :qp0 || (SELECT ARRAY[9,10]::int[])))',
649+
[[1, 2, 3], new ArrayValue([5, 6, 7]), $stringParam, self::getDb()->select(new ArrayValue([9, 10]))],
650+
'ARRAY(SELECT DISTINCT UNNEST(ARRAY[1,2,3]::int[] || ARRAY[5,6,7]::int[] || :qp0 || (SELECT ARRAY[9,10]::int[])))',
651651
[1, 2, 3, 4, 5, 6, 7, 9, 10],
652652
[
653653
':qp0' => $stringParam,

tests/QueryBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,15 +637,15 @@ public function testArrayMergeWithTypeWithOrdering(
637637

638638
$stringParam = new Param('{4,3,5}', DataType::STRING);
639639
$arrayMerge = (new ArrayMerge(
640-
'ARRAY[2,1,3]',
641-
[6, 5, 7],
640+
[2, 1, 3],
641+
new ArrayValue([6, 5, 7]),
642642
$stringParam,
643643
self::getDb()->select(new ArrayValue([10, 9])),
644644
))->type($type)->ordered();
645645
$params = [];
646646

647647
$this->assertSame(
648-
"ARRAY(SELECT DISTINCT UNNEST(ARRAY[2,1,3]$typeHint || ARRAY[6,5,7]::int[]$typeHint || :qp0$typeHint || (SELECT ARRAY[10,9]::int[])$typeHint) ORDER BY 1)$typeHint",
648+
"ARRAY(SELECT DISTINCT UNNEST(ARRAY[2,1,3]::int[]$typeHint || ARRAY[6,5,7]::int[]$typeHint || :qp0$typeHint || (SELECT ARRAY[10,9]::int[])$typeHint) ORDER BY 1)$typeHint",
649649
$qb->buildExpression($arrayMerge, $params)
650650
);
651651
$this->assertSame([':qp0' => $stringParam], $params);

0 commit comments

Comments
 (0)