| @@ 392-430 (lines=39) @@ | ||
| 389 | /** |
|
| 390 | * @group DBAL-2511 |
|
| 391 | */ |
|
| 392 | public function testUpdateWithSameColumnInDataAndIdentifiers() : void |
|
| 393 | { |
|
| 394 | $conn = $this->getExecuteUpdateMockConnection(); |
|
| 395 | ||
| 396 | $conn->expects($this->once()) |
|
| 397 | ->method('executeUpdate') |
|
| 398 | ->with( |
|
| 399 | 'UPDATE TestTable SET text = ?, is_edited = ? WHERE id = ? AND is_edited = ?', |
|
| 400 | [ |
|
| 401 | 'some text', |
|
| 402 | true, |
|
| 403 | 1, |
|
| 404 | false, |
|
| 405 | ], |
|
| 406 | [ |
|
| 407 | 'string', |
|
| 408 | 'boolean', |
|
| 409 | 'integer', |
|
| 410 | 'boolean', |
|
| 411 | ] |
|
| 412 | ); |
|
| 413 | ||
| 414 | $conn->update( |
|
| 415 | 'TestTable', |
|
| 416 | [ |
|
| 417 | 'text' => 'some text', |
|
| 418 | 'is_edited' => true, |
|
| 419 | ], |
|
| 420 | [ |
|
| 421 | 'id' => 1, |
|
| 422 | 'is_edited' => false, |
|
| 423 | ], |
|
| 424 | [ |
|
| 425 | 'text' => 'string', |
|
| 426 | 'is_edited' => 'boolean', |
|
| 427 | 'id' => 'integer', |
|
| 428 | ] |
|
| 429 | ); |
|
| 430 | } |
|
| 431 | ||
| 432 | /** |
|
| 433 | * @group DBAL-2688 |
|
| @@ 435-472 (lines=38) @@ | ||
| 432 | /** |
|
| 433 | * @group DBAL-2688 |
|
| 434 | */ |
|
| 435 | public function testUpdateWithIsNull() : void |
|
| 436 | { |
|
| 437 | $conn = $this->getExecuteUpdateMockConnection(); |
|
| 438 | ||
| 439 | $conn->expects($this->once()) |
|
| 440 | ->method('executeUpdate') |
|
| 441 | ->with( |
|
| 442 | 'UPDATE TestTable SET text = ?, is_edited = ? WHERE id IS NULL AND name = ?', |
|
| 443 | [ |
|
| 444 | 'some text', |
|
| 445 | null, |
|
| 446 | 'foo', |
|
| 447 | ], |
|
| 448 | [ |
|
| 449 | 'string', |
|
| 450 | 'boolean', |
|
| 451 | 'string', |
|
| 452 | ] |
|
| 453 | ); |
|
| 454 | ||
| 455 | $conn->update( |
|
| 456 | 'TestTable', |
|
| 457 | [ |
|
| 458 | 'text' => 'some text', |
|
| 459 | 'is_edited' => null, |
|
| 460 | ], |
|
| 461 | [ |
|
| 462 | 'id' => null, |
|
| 463 | 'name' => 'foo', |
|
| 464 | ], |
|
| 465 | [ |
|
| 466 | 'text' => 'string', |
|
| 467 | 'is_edited' => 'boolean', |
|
| 468 | 'id' => 'integer', |
|
| 469 | 'name' => 'string', |
|
| 470 | ] |
|
| 471 | ); |
|
| 472 | } |
|
| 473 | ||
| 474 | /** |
|
| 475 | * @group DBAL-2688 |
|