1 | <?php |
||
43 | class PDOTest extends PHPUnit_Framework_TestCase |
||
44 | { |
||
45 | /** |
||
46 | * @var PDO |
||
47 | */ |
||
48 | protected $pdo; |
||
49 | |||
50 | /** |
||
51 | * @var PHPUnit_Framework_MockObject_MockObject|ClientInterface |
||
52 | */ |
||
53 | protected $client; |
||
54 | |||
55 | protected function setUp() |
||
67 | |||
68 | /** |
||
69 | * @covers ::__construct |
||
70 | */ |
||
71 | public function testInstantiation() |
||
78 | |||
79 | public function testInstantiationWithDefaultSchema() |
||
86 | |||
87 | /** |
||
88 | * @covers ::__construct |
||
89 | */ |
||
90 | public function testInstantiationWithTraversableOptions() |
||
95 | |||
96 | /** |
||
97 | * @covers ::__construct |
||
98 | */ |
||
99 | public function testInstantiationWithInvalidOptions() |
||
105 | |||
106 | /** |
||
107 | * @covers ::__construct |
||
108 | */ |
||
109 | public function testInstantiationWithHttpAuth() { |
||
115 | |||
116 | /** |
||
117 | * @covers ::setAttribute |
||
118 | */ |
||
119 | public function testSetAttributeWithHttpBasicAuth() |
||
139 | |||
140 | /** |
||
141 | * @covers ::getAttribute |
||
142 | */ |
||
143 | public function testGetAttributeWithInvalidAttribute() |
||
148 | |||
149 | /** |
||
150 | * @covers ::setAttribute |
||
151 | */ |
||
152 | public function testSetAttributeWithInvalidAttribute() |
||
157 | |||
158 | /** |
||
159 | * @covers ::getAttribute |
||
160 | * @covers ::setAttribute |
||
161 | */ |
||
162 | public function testGetAndSetDefaultFetchMode() |
||
168 | |||
169 | /** |
||
170 | * @covers ::getAttribute |
||
171 | * @covers ::setAttribute |
||
172 | */ |
||
173 | public function testGetAndSetErrorMode() |
||
179 | |||
180 | /** |
||
181 | * @covers ::getAttribute |
||
182 | */ |
||
183 | public function testGetVersion() |
||
187 | |||
188 | /** |
||
189 | * @covers ::getAttribute |
||
190 | */ |
||
191 | public function testGetDriverName() |
||
195 | |||
196 | public function testGetStatementClass() |
||
200 | |||
201 | /** |
||
202 | * @covers ::getAttribute |
||
203 | */ |
||
204 | public function testPersistent() |
||
208 | |||
209 | /** |
||
210 | * @covers ::getAttribute |
||
211 | */ |
||
212 | public function testPreFetch() |
||
216 | |||
217 | /** |
||
218 | * @covers ::getAttribute |
||
219 | */ |
||
220 | public function testAutoCommit() |
||
224 | |||
225 | /** |
||
226 | * @covers ::getAttribute |
||
227 | * @covers ::setAttribute |
||
228 | */ |
||
229 | public function testGetAndSetTimeout() |
||
244 | |||
245 | /** |
||
246 | * @covers ::quote |
||
247 | */ |
||
248 | public function testQuote() |
||
256 | |||
257 | /** |
||
258 | * @return array |
||
259 | */ |
||
260 | public function quoteExceptionProvider() |
||
268 | |||
269 | /** |
||
270 | * @dataProvider quoteExceptionProvider |
||
271 | * @covers ::quote |
||
272 | * |
||
273 | * @param int $paramType |
||
274 | * @param string $message |
||
275 | */ |
||
276 | public function testQuoteWithExpectedException($paramType, $exception, $message) |
||
281 | |||
282 | /** |
||
283 | * @covers ::prepare |
||
284 | */ |
||
285 | public function testPrepareReturnsAPDOStatement() |
||
290 | |||
291 | /** |
||
292 | * @covers ::getAvailableDrivers |
||
293 | */ |
||
294 | public function testAvailableDriversContainsCrate() |
||
298 | |||
299 | /** |
||
300 | * @covers ::beginTransaction |
||
301 | */ |
||
302 | public function testBeginTransactionThrowsUnsupportedException() |
||
306 | |||
307 | /** |
||
308 | * @covers ::commit |
||
309 | */ |
||
310 | public function testCommitThrowsUnsupportedException() |
||
314 | |||
315 | /** |
||
316 | * @covers ::rollback |
||
317 | */ |
||
318 | public function testRollbackThrowsUnsupportedException() |
||
323 | |||
324 | /** |
||
325 | * @covers ::inTransaction |
||
326 | */ |
||
327 | public function testInTransactionThrowsUnsupportedException() |
||
331 | |||
332 | /** |
||
333 | * @covers ::lastInsertId |
||
334 | */ |
||
335 | public function testLastInsertIdThrowsUnsupportedException() |
||
340 | } |
||
341 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: