Code Duplication    Length = 23-26 lines in 4 locations

tests/unit/GigyaTest.php 4 locations

@@ 417-440 (lines=24) @@
414
        $client->custom('params');
415
    }
416
417
    public function testAddingOptionsPassesThroughTheOptionsToGuzzle()
418
    {
419
        $gigyaResponse = $this->setupCall(
420
            'accounts.getAccountInfo',
421
            'https://accounts.eu1.gigya.com/accounts.getAccountInfo',
422
            [
423
                'auth'        => 'gigya',
424
                'verify'      => $this->certPath,
425
                'form_params' => [
426
                    'params' => 'passedThrough',
427
                ],
428
                'option1'     => 'value1',
429
                'option2'     => false,
430
            ]
431
        );
432
        $client = $this->createClient();
433
434
        $client->addOption('option1', 'value1');
435
        $client->addOption('option2', false);
436
437
        $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']);
438
439
        static::assertSame($gigyaResponse, $result);
440
    }
441
442
    public function testAddingOptionsWithASingleCallPassesThroughTheOptionsToGuzzle()
443
    {
@@ 442-467 (lines=26) @@
439
        static::assertSame($gigyaResponse, $result);
440
    }
441
442
    public function testAddingOptionsWithASingleCallPassesThroughTheOptionsToGuzzle()
443
    {
444
        $gigyaResponse = $this->setupCall(
445
            'accounts.getAccountInfo',
446
            'https://accounts.eu1.gigya.com/accounts.getAccountInfo',
447
            [
448
                'auth'        => 'gigya',
449
                'verify'      => $this->certPath,
450
                'form_params' => [
451
                    'params' => 'passedThrough',
452
                ],
453
                'option1'     => 'value1',
454
                'option2'     => true,
455
            ]
456
        );
457
        $client = $this->createClient();
458
459
        $client->addOptions(
460
            [
461
                'option1' => 'value1',
462
                'option2' => true,
463
            ]
464
        );
465
466
        $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']);
467
468
        static::assertSame($gigyaResponse, $result);
469
    }
470
@@ 471-493 (lines=23) @@
468
        static::assertSame($gigyaResponse, $result);
469
    }
470
471
    public function testAddingTheSameOptionAgainWillTakeTheLastValueSet()
472
    {
473
        $gigyaResponse = $this->setupCall(
474
            'accounts.getAccountInfo',
475
            'https://accounts.eu1.gigya.com/accounts.getAccountInfo',
476
            [
477
                'auth'        => 'gigya',
478
                'verify'      => $this->certPath,
479
                'form_params' => [
480
                    'params' => 'passedThrough',
481
                ],
482
                'option1'     => false,
483
            ]
484
        );
485
        $client = $this->createClient();
486
487
        $client->addOption('option1', 'value1');
488
        $client->addOption('option1', false);
489
490
        $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']);
491
492
        static::assertSame($gigyaResponse, $result);
493
    }
494
495
    public function testAddingTheSameOptionAgainWithAddOptionsWillTakeTheLastValueSet()
496
    {
@@ 495-517 (lines=23) @@
492
        static::assertSame($gigyaResponse, $result);
493
    }
494
495
    public function testAddingTheSameOptionAgainWithAddOptionsWillTakeTheLastValueSet()
496
    {
497
        $gigyaResponse = $this->setupCall(
498
            'accounts.getAccountInfo',
499
            'https://accounts.eu1.gigya.com/accounts.getAccountInfo',
500
            [
501
                'auth'        => 'gigya',
502
                'verify'      => $this->certPath,
503
                'form_params' => [
504
                    'params' => 'passedThrough',
505
                ],
506
                'option1'     => true,
507
            ]
508
        );
509
        $client = $this->createClient();
510
511
        $client->addOption('option1', 'value1');
512
        $client->addOptions(['option1' => true]);
513
514
        $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']);
515
516
        static::assertSame($gigyaResponse, $result);
517
    }
518
519
    public function testAddingFormParamsOptionsWillBeIgnored()
520
    {