1414use Yiisoft \Db \Pgsql \Column \IntegerColumn ;
1515use Yiisoft \Db \Pgsql \Tests \Support \TestTrait ;
1616use Yiisoft \Db \Query \Query ;
17+ use Yiisoft \Db \QueryBuilder \Condition \LikeConjunction ;
1718
1819use function array_replace ;
1920use function version_compare ;
@@ -67,14 +68,14 @@ public static function buildCondition(): array
6768 /* empty values */
6869 [['ilike ' , 'name ' , []], '0=1 ' , []],
6970 [['not ilike ' , 'name ' , []], '' , []],
70- [['or ilike ' , 'name ' , []], '0=1 ' , []],
71- [['or not ilike ' , 'name ' , []], '' , []],
71+ [['ilike ' , 'name ' , [], ' conjunction ' => LikeConjunction::Or ], '0=1 ' , []],
72+ [['not ilike ' , 'name ' , [], ' conjunction ' => LikeConjunction::Or ], '' , []],
7273
7374 /* simple ilike */
7475 [['ilike ' , 'name ' , 'heyho ' ], '"name" ILIKE :qp0 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING )]],
7576 [['not ilike ' , 'name ' , 'heyho ' ], '"name" NOT ILIKE :qp0 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING )]],
76- [['or ilike ' , 'name ' , 'heyho ' ], '"name" ILIKE :qp0 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING )]],
77- [['or not ilike ' , 'name ' , 'heyho ' ], '"name" NOT ILIKE :qp0 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING )]],
77+ [['ilike ' , 'name ' , 'heyho ' , ' conjunction ' => LikeConjunction::Or ], '"name" ILIKE :qp0 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING )]],
78+ [['not ilike ' , 'name ' , 'heyho ' , ' conjunction ' => LikeConjunction::Or ], '"name" NOT ILIKE :qp0 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING )]],
7879
7980 /* ilike for many values */
8081 [
@@ -88,11 +89,11 @@ public static function buildCondition(): array
8889 [':qp0 ' => new Param ('%heyho% ' , DataType::STRING ), ':qp1 ' => new Param ('%abc% ' , DataType::STRING )],
8990 ],
9091 [
91- ['or ilike ' , 'name ' , ['heyho ' , 'abc ' ]],
92+ ['ilike ' , 'name ' , ['heyho ' , 'abc ' ], ' conjunction ' => LikeConjunction::Or ],
9293 '"name" ILIKE :qp0 OR "name" ILIKE :qp1 ' , [':qp0 ' => new Param ('%heyho% ' , DataType::STRING ), ':qp1 ' => new Param ('%abc% ' , DataType::STRING )],
9394 ],
9495 [
95- ['or not ilike ' , 'name ' , ['heyho ' , 'abc ' ]],
96+ ['not ilike ' , 'name ' , ['heyho ' , 'abc ' ], ' conjunction ' => LikeConjunction::Or ],
9697 '"name" NOT ILIKE :qp0 OR "name" NOT ILIKE :qp1 ' ,
9798 [':qp0 ' => new Param ('%heyho% ' , DataType::STRING ), ':qp1 ' => new Param ('%abc% ' , DataType::STRING )],
9899 ],
0 commit comments