2222use Yiisoft \Db \QueryBuilder \QueryBuilderInterface ;
2323use Yiisoft \Db \Schema \Column \ColumnBuilder ;
2424use Yiisoft \Db \Tests \Support \DbHelper ;
25+ use Yiisoft \Db \Tests \Support \IntEnum ;
2526use Yiisoft \Db \Tests \Support \JsonSerializableObject ;
2627use Yiisoft \Db \Tests \Support \Stringable ;
28+ use Yiisoft \Db \Tests \Support \StringEnum ;
2729use Yiisoft \Db \Tests \Support \TestTrait ;
2830use Yiisoft \Db \Tests \Support \TraversableObject ;
2931
@@ -1753,6 +1755,8 @@ public static function prepareParam(): array
17531755 'expression ' => ['(1 + 2) ' , new Expression ('(1 + 2) ' ), DataType::STRING ],
17541756 'expression with params ' => ['(1 + 2) ' , new Expression ('(:a + :b) ' , [':a ' => 1 , 'b ' => 2 ]), DataType::STRING ],
17551757 'Stringable ' => ["'string' " , new Stringable ('string ' ), DataType::STRING ],
1758+ 'StringEnum ' => ["'one' " , StringEnum::ONE , DataType::STRING ],
1759+ 'IntEnum ' => ['1 ' , IntEnum::ONE , DataType::STRING ],
17561760 ];
17571761 }
17581762
@@ -1773,6 +1777,8 @@ public static function prepareValue(): array
17731777 'expression ' => ['(1 + 2) ' , new Expression ('(1 + 2) ' )],
17741778 'expression with params ' => ['(1 + 2) ' , new Expression ('(:a + :b) ' , [':a ' => 1 , 'b ' => 2 ])],
17751779 'Stringable ' => ["'string' " , new Stringable ('string ' )],
1780+ 'StringEnum ' => ["'one' " , StringEnum::ONE ],
1781+ 'IntEnum ' => ['1 ' , IntEnum::ONE ],
17761782 'array ' => ['\'["a","b","c"] \'' , ['a ' , 'b ' , 'c ' ]],
17771783 'json ' => ['\'{"a":1,"b":2} \'' , ['a ' => 1 , 'b ' => 2 ]],
17781784 'Iterator ' => ['\'["a","b","c"] \'' , new ArrayIterator (['a ' , 'b ' , 'c ' ])],
@@ -1784,11 +1790,11 @@ public static function prepareValue(): array
17841790 public static function buildValue (): array
17851791 {
17861792 return [
1787- 'null ' => [null , 'NULL ' , [] ],
1788- 'true ' => [true , 'TRUE ' , [] ],
1789- 'false ' => [false , 'FALSE ' , [] ],
1790- 'integer ' => [1 , '1 ' , [] ],
1791- 'float ' => [1.1 , '1.1 ' , [] ],
1793+ 'null ' => [null , 'NULL ' ],
1794+ 'true ' => [true , 'TRUE ' ],
1795+ 'false ' => [false , 'FALSE ' ],
1796+ 'integer ' => [1 , '1 ' ],
1797+ 'float ' => [1.1 , '1.1 ' ],
17921798 'string ' => [
17931799 'string ' ,
17941800 ':qp0 ' ,
@@ -1817,7 +1823,6 @@ public static function buildValue(): array
18171823 'expression ' => [
18181824 new Expression ('(1 + 2) ' ),
18191825 '(1 + 2) ' ,
1820- [],
18211826 ],
18221827 'expression with params ' => [
18231828 new Expression ('(:a + :b) ' , [':a ' => 1 , 'b ' => 2 ]),
@@ -1829,6 +1834,12 @@ public static function buildValue(): array
18291834 ':qp0 ' ,
18301835 [':qp0 ' => new Param ('string ' , DataType::STRING )],
18311836 ],
1837+ 'StringEnum ' => [
1838+ StringEnum::ONE ,
1839+ ':qp0 ' ,
1840+ [':qp0 ' => new Param ('one ' , DataType::STRING )],
1841+ ],
1842+ 'IntEnum ' => [IntEnum::ONE , '1 ' ],
18321843 'array ' => [
18331844 ['a ' , 'b ' , 'c ' ],
18341845 ':qp0 ' ,
0 commit comments