@@ -157,21 +157,19 @@ public function testWithParamBound(callable $executeMethod)
157157
158158 $ expectedRes = $ res = $ this ->getResourceFromString ('mydata ' );
159159
160- $ stmt ->bindValue (2 , $ price );
161- $ stmt ->bindValue (3 , $ stock , ParameterType::INTEGER );
160+ $ stmt = $ this ->conn ->prepare ($ sql );
161+ $ stmt ->bindValue (1 , 'product1 ' );
162+ $ stmt ->bindValue (2 , '12.5 ' );
163+ $ stmt ->bindValue (3 , 5 , ParameterType::INTEGER );
162164 $ stmt ->bindValue (4 , $ res , ParameterType::BINARY );
163165
164- $ product = 'product1 ' ;
165- $ price = '12.5 ' ;
166- $ stock = 5 ;
167-
168166 $ executeMethod ($ stmt );
169167
170168 // Debug data should not be affected by these changes
171169 $ debug = $ this ->debugDataHolder ->getData ()['default ' ] ?? [];
172170 $ this ->assertCount (2 , $ debug );
173171 $ this ->assertSame ($ sql , $ debug [1 ]['sql ' ]);
174- $ this ->assertSame (['product1 ' , 12.5 , 5 , $ expectedRes ], $ debug [1 ]['params ' ]);
172+ $ this ->assertSame (['product1 ' , ' 12.5 ' , 5 , $ expectedRes ], $ debug [1 ]['params ' ]);
175173 $ this ->assertSame ([ParameterType::STRING , ParameterType::STRING , ParameterType::INTEGER , ParameterType::BINARY ], $ debug [1 ]['types ' ]);
176174 $ this ->assertGreaterThan (0 , $ debug [1 ]['executionMS ' ]);
177175 }
0 commit comments