@@ -145,23 +145,31 @@ public function testWithParamBound(callable $executeMethod)
145145 {
146146 $ this ->init ();
147147
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 ' );
151154
152- $ stmt = $ this ->conn ->prepare (' INSERT INTO products(name, price, stock) VALUES (?, ?, ?) ' );
155+ $ stmt = $ this ->conn ->prepare ($ sql );
153156 $ stmt ->bindParam (1 , $ product );
154157 $ stmt ->bindParam (2 , $ price );
155158 $ stmt ->bindParam (3 , $ stock , ParameterType::INTEGER );
159+ $ stmt ->bindParam (4 , $ res , ParameterType::BINARY );
160+
161+ $ product = 'product1 ' ;
162+ $ price = 12.5 ;
163+ $ stock = 5 ;
156164
157165 $ executeMethod ($ stmt );
158166
159167 // Debug data should not be affected by these changes
160168 $ debug = $ this ->debugDataHolder ->getData ()['default ' ] ?? [];
161169 $ 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 ' ]);
170+ $ this ->assertSame ($ sql , $ debug [1 ]['sql ' ]);
171+ $ this ->assertSame (['product1 ' , 12.5 , 5 , $ expectedRes ], $ debug [1 ]['params ' ]);
172+ $ this ->assertSame ([ParameterType::STRING , ParameterType::STRING , ParameterType::INTEGER , ParameterType:: BINARY ], $ debug [1 ]['types ' ]);
165173 $ this ->assertGreaterThan (0 , $ debug [1 ]['executionMS ' ]);
166174 }
167175
0 commit comments