Code Duplication    Length = 38-39 lines in 2 locations

tests/Doctrine/Tests/DBAL/ConnectionTest.php 2 locations

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