diff --git a/tests/framework/db/mysql/QueryBuilderTest.php b/tests/framework/db/mysql/QueryBuilderTest.php index a256e16d5f..83585865ed 100644 --- a/tests/framework/db/mysql/QueryBuilderTest.php +++ b/tests/framework/db/mysql/QueryBuilderTest.php @@ -210,4 +210,26 @@ class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest ], ]); } + + public function updateProvider() + { + $items = parent::updateProvider(); + + $items[] = [ + 'profile', + [ + 'description' => new JsonExpression(['abc' => 'def', 123, null]), + ], + [ + 'id' => 1, + ], + $this->replaceQuotes('UPDATE [[profile]] SET [[description]]=:qp0 WHERE [[id]]=:qp1'), + [ + ':qp0' => '{"abc":"def","0":123,"1":null}', + ':qp1' => 1, + ], + ]; + + return $items; + } } diff --git a/tests/framework/db/pgsql/QueryBuilderTest.php b/tests/framework/db/pgsql/QueryBuilderTest.php index c8e0480440..09d6f925d8 100644 --- a/tests/framework/db/pgsql/QueryBuilderTest.php +++ b/tests/framework/db/pgsql/QueryBuilderTest.php @@ -331,4 +331,26 @@ class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest } return $newData; } + + public function updateProvider() + { + $items = parent::updateProvider(); + + $items[] = [ + 'profile', + [ + 'description' => new JsonExpression(['abc' => 'def', 123, null]), + ], + [ + 'id' => 1, + ], + $this->replaceQuotes('UPDATE [[profile]] SET [[description]]=:qp0 WHERE [[id]]=:qp1'), + [ + ':qp0' => '{"abc":"def","0":123,"1":null}', + ':qp1' => 1, + ], + ]; + + return $items; + } }