| @@ 365-403 (lines=39) @@ | ||
| 362 | /** |
|
| 363 | * @group DBAL-2511 |
|
| 364 | */ |
|
| 365 | public function testUpdateWithSameColumnInDataAndIdentifiers() |
|
| 366 | { |
|
| 367 | $conn = $this->getExecuteUpdateMockConnection(); |
|
| 368 | ||
| 369 | $conn->expects($this->once()) |
|
| 370 | ->method('executeUpdate') |
|
| 371 | ->with( |
|
| 372 | 'UPDATE TestTable SET text = ?, is_edited = ? WHERE id = ? AND is_edited = ?', |
|
| 373 | [ |
|
| 374 | 'some text', |
|
| 375 | true, |
|
| 376 | 1, |
|
| 377 | false, |
|
| 378 | ], |
|
| 379 | [ |
|
| 380 | 'string', |
|
| 381 | 'boolean', |
|
| 382 | 'integer', |
|
| 383 | 'boolean', |
|
| 384 | ] |
|
| 385 | ); |
|
| 386 | ||
| 387 | $conn->update( |
|
| 388 | 'TestTable', |
|
| 389 | [ |
|
| 390 | 'text' => 'some text', |
|
| 391 | 'is_edited' => true, |
|
| 392 | ], |
|
| 393 | [ |
|
| 394 | 'id' => 1, |
|
| 395 | 'is_edited' => false, |
|
| 396 | ], |
|
| 397 | [ |
|
| 398 | 'text' => 'string', |
|
| 399 | 'is_edited' => 'boolean', |
|
| 400 | 'id' => 'integer', |
|
| 401 | ] |
|
| 402 | ); |
|
| 403 | } |
|
| 404 | ||
| 405 | /** |
|
| 406 | * @group DBAL-2688 |
|
| @@ 408-445 (lines=38) @@ | ||
| 405 | /** |
|
| 406 | * @group DBAL-2688 |
|
| 407 | */ |
|
| 408 | public function testUpdateWithIsNull() |
|
| 409 | { |
|
| 410 | $conn = $this->getExecuteUpdateMockConnection(); |
|
| 411 | ||
| 412 | $conn->expects($this->once()) |
|
| 413 | ->method('executeUpdate') |
|
| 414 | ->with( |
|
| 415 | 'UPDATE TestTable SET text = ?, is_edited = ? WHERE id IS NULL AND name = ?', |
|
| 416 | [ |
|
| 417 | 'some text', |
|
| 418 | null, |
|
| 419 | 'foo', |
|
| 420 | ], |
|
| 421 | [ |
|
| 422 | 'string', |
|
| 423 | 'boolean', |
|
| 424 | 'string', |
|
| 425 | ] |
|
| 426 | ); |
|
| 427 | ||
| 428 | $conn->update( |
|
| 429 | 'TestTable', |
|
| 430 | [ |
|
| 431 | 'text' => 'some text', |
|
| 432 | 'is_edited' => null, |
|
| 433 | ], |
|
| 434 | [ |
|
| 435 | 'id' => null, |
|
| 436 | 'name' => 'foo', |
|
| 437 | ], |
|
| 438 | [ |
|
| 439 | 'text' => 'string', |
|
| 440 | 'is_edited' => 'boolean', |
|
| 441 | 'id' => 'integer', |
|
| 442 | 'name' => 'string', |
|
| 443 | ] |
|
| 444 | ); |
|
| 445 | } |
|
| 446 | ||
| 447 | /** |
|
| 448 | * @group DBAL-2688 |
|