@@ -2103,27 +2103,27 @@ protected function internalExecute(): void {}
21032103
21042104 public function testDecimalValue (): void
21052105 {
2106- $ decimalValue = 10.0 ;
21072106 $ db = $ this ->getSharedConnection ();
21082107 $ this ->loadFixture ();
21092108
2110- $ inserted = $ db ->createCommand ()
2109+ $ inserted = $ db
2110+ ->createCommand ()
21112111 ->insertReturningPks (
21122112 '{{%order}} ' ,
2113- ['customer_id ' => 1 , 'created_at ' => 0 , 'total ' => $ decimalValue ],
2113+ ['customer_id ' => 1 , 'created_at ' => 0 , 'total ' => 10.0 ],
21142114 );
21152115
2116- $ result = $ db ->createCommand (
2117- 'select * from {{%order}} where [[id]]=:id ' ,
2118- ['id ' => $ inserted ['id ' ]],
2119- )->queryOne ();
2116+ $ result = $ db
2117+ ->createCommand (
2118+ 'select * from {{%order}} where [[id]]=:id ' ,
2119+ ['id ' => $ inserted ['id ' ]],
2120+ )
2121+ ->queryOne ();
21202122
21212123 $ column = $ db ->getTableSchema ('{{%order}} ' )->getColumn ('total ' );
21222124 $ phpTypecastValue = $ column ->phpTypecast ($ result ['total ' ]);
21232125
2124- $ this ->assertSame ($ decimalValue , $ phpTypecastValue );
2125-
2126- $ db ->close ();
2126+ $ this ->assertSame ('10 ' , $ phpTypecastValue );
21272127 }
21282128
21292129 public function testInsertReturningPksEmptyValues ()
@@ -2179,9 +2179,9 @@ public function testInsertReturningPksWithPhpTypecasting(): void
21792179
21802180 $ result = $ db ->createCommand ()
21812181 ->withPhpTypecasting ()
2182- ->insertReturningPks ('notauto_pk ' , ['id_1 ' => 1 , 'id_2 ' => 2.5 , 'type ' => 'test1 ' ]);
2182+ ->insertReturningPks ('notauto_pk ' , ['id_1 ' => 1 , 'id_2 ' => ' 2.5 ' , 'type ' => 'test1 ' ]);
21832183
2184- $ this ->assertSame (['id_1 ' => 1 , 'id_2 ' => 2.5 ], $ result );
2184+ $ this ->assertSame (['id_1 ' => 1 , 'id_2 ' => ' 2.5 ' ], $ result );
21852185
21862186 $ db ->close ();
21872187 }
@@ -2333,21 +2333,21 @@ public function testUpsertReturningPksWithPhpTypecasting(): void
23332333
23342334 $ result = $ db ->createCommand ()
23352335 ->withPhpTypecasting ()
2336- ->upsertReturningPks ('notauto_pk ' , ['id_1 ' => 1 , 'id_2 ' => 2.5 , 'type ' => 'test1 ' ]);
2336+ ->upsertReturningPks ('notauto_pk ' , ['id_1 ' => 1 , 'id_2 ' => ' 2.5 ' , 'type ' => 'test1 ' ]);
23372337
2338- $ this ->assertSame (['id_1 ' => 1 , 'id_2 ' => 2.5 ], $ result );
2338+ $ this ->assertSame (['id_1 ' => 1 , 'id_2 ' => ' 2.5 ' ], $ result );
23392339
23402340 $ result = $ db ->createCommand ()
23412341 ->withPhpTypecasting ()
2342- ->upsertReturningPks ('notauto_pk ' , ['id_1 ' => 2 , 'id_2 ' => 2.5 , 'type ' => 'test2 ' ]);
2342+ ->upsertReturningPks ('notauto_pk ' , ['id_1 ' => 2 , 'id_2 ' => ' 2.5 ' , 'type ' => 'test2 ' ]);
23432343
2344- $ this ->assertSame (['id_1 ' => 2 , 'id_2 ' => 2.5 ], $ result );
2344+ $ this ->assertSame (['id_1 ' => 2 , 'id_2 ' => ' 2.5 ' ], $ result );
23452345
23462346 $ result = $ db ->createCommand ()
23472347 ->withPhpTypecasting ()
2348- ->upsertReturningPks ('notauto_pk ' , ['id_1 ' => 2 , 'id_2 ' => 2.5 , 'type ' => 'test3 ' ]);
2348+ ->upsertReturningPks ('notauto_pk ' , ['id_1 ' => 2 , 'id_2 ' => ' 2.5 ' , 'type ' => 'test3 ' ]);
23492349
2350- $ this ->assertSame (['id_1 ' => 2 , 'id_2 ' => 2.5 ], $ result );
2350+ $ this ->assertSame (['id_1 ' => 2 , 'id_2 ' => ' 2.5 ' ], $ result );
23512351
23522352 $ db ->close ();
23532353 }
0 commit comments