@@ -145,23 +145,32 @@ public function testWithParamBound(callable $executeMethod)
145
145
{
146
146
$ this ->init ();
147
147
148
- $ product = 'product1 ' ;
149
- $ price = 12.5 ;
150
- $ stock = 5 ;
148
+ $ sql = <<<EOT
149
+ INSERT INTO products(name, price, stock, picture, tags)
150
+ VALUES (?, ?, ?, ?, ?)
151
+ EOT ;
152
+
153
+ $ expectedRes = $ res = $ this ->getResourceFromString ('mydata ' );
151
154
152
- $ stmt = $ this ->conn ->prepare (' INSERT INTO products(name, price, stock) VALUES (?, ?, ?) ' );
155
+ $ stmt = $ this ->conn ->prepare ($ sql );
153
156
$ stmt ->bindParam (1 , $ product );
154
157
$ stmt ->bindParam (2 , $ price );
155
158
$ stmt ->bindParam (3 , $ stock , ParameterType::INTEGER );
159
+ $ stmt ->bindParam (4 , $ res , ParameterType::BINARY );
160
+
161
+ $ product = 'product1 ' ;
162
+ $ price = 12.5 ;
163
+ $ stock = 5 ;
164
+
156
165
157
166
$ executeMethod ($ stmt );
158
167
159
168
// Debug data should not be affected by these changes
160
169
$ debug = $ this ->debugDataHolder ->getData ()['default ' ] ?? [];
161
170
$ this ->assertCount (2 , $ debug );
162
- $ this ->assertSame (' INSERT INTO products(name, price, stock) VALUES (?, ?, ?) ' , $ debug [1 ]['sql ' ]);
163
- $ this ->assertSame (['product1 ' , ' 12.5 ' , 5 ], $ debug [1 ]['params ' ]);
164
- $ this ->assertSame ([ParameterType::STRING , ParameterType::STRING , ParameterType::INTEGER ], $ debug [1 ]['types ' ]);
171
+ $ this ->assertSame ($ sql , $ debug [1 ]['sql ' ]);
172
+ $ this ->assertSame (['product1 ' , 12.5 , 5 , $ expectedRes ], $ debug [1 ]['params ' ]);
173
+ $ this ->assertSame ([ParameterType::STRING , ParameterType::STRING , ParameterType::INTEGER , ParameterType:: BINARY ], $ debug [1 ]['types ' ]);
165
174
$ this ->assertGreaterThan (0 , $ debug [1 ]['executionMS ' ]);
166
175
}
167
176
0 commit comments