Code Duplication    Length = 19-21 lines in 5 locations

tests/unit/GigyaTest.php 5 locations

@@ 320-338 (lines=19) @@
317
        static::assertSame($gigyaResponse, $result);
318
    }
319
320
    public function testPassingParamsThroughToTheMethodWillPassThroughToGuzzle()
321
    {
322
        $gigyaResponse = $this->setupCall(
323
            'accounts.getAccountInfo',
324
            'https://socialize.eu1.gigya.com/socialize.notifyLogin',
325
            [
326
                'auth'        => 'gigya',
327
                'verify'      => $this->certPath,
328
                'form_params' => [
329
                    'param' => 'passedThrough',
330
                ],
331
            ]
332
        );
333
        $client = $this->createClient();
334
335
        $result = $client->socialize()->notifyLogin(['param' => 'passedThrough']);
336
337
        static::assertSame($gigyaResponse, $result);
338
    }
339
340
    public function testCallingChildMethodsCallTheCorrectUri()
341
    {
@@ 340-358 (lines=19) @@
337
        static::assertSame($gigyaResponse, $result);
338
    }
339
340
    public function testCallingChildMethodsCallTheCorrectUri()
341
    {
342
        $gigyaResponse = $this->setupCall(
343
            'accounts.getAccountInfo',
344
            'https://fidm.eu1.gigya.com/fidm.saml.idp.getConfig',
345
            [
346
                'auth'        => 'gigya',
347
                'verify'      => $this->certPath,
348
                'form_params' => [
349
                    'params' => 'passedThrough',
350
                ],
351
            ]
352
        );
353
        $client = $this->createClient();
354
355
        $result = $client->saml()->idp()->getConfig(['params' => 'passedThrough']);
356
357
        static::assertSame($gigyaResponse, $result);
358
    }
359
360
    public function testTfaCallingChildMethodsCallTheCorrectUri()
361
    {
@@ 360-378 (lines=19) @@
357
        static::assertSame($gigyaResponse, $result);
358
    }
359
360
    public function testTfaCallingChildMethodsCallTheCorrectUri()
361
    {
362
        $gigyaResponse = $this->setupCall(
363
            'accounts.getAccountInfo',
364
            'https://accounts.eu1.gigya.com/accounts.tfa.getCertificate',
365
            [
366
                'auth'        => 'gigya',
367
                'verify'      => $this->certPath,
368
                'form_params' => [
369
                    'params' => 'passedThrough',
370
                ],
371
            ]
372
        );
373
        $client = $this->createClient();
374
375
        $result = $client->accounts()->tfa()->getCertificate(['params' => 'passedThrough']);
376
377
        static::assertSame($gigyaResponse, $result);
378
    }
379
380
    /**
381
     * @dataProvider clientCallDataProvider
@@ 609-629 (lines=21) @@
606
        static::assertSame($gigyaResponse, $result);
607
    }
608
609
    public function testSettingParamsWillNotOverwriteTheDefaultParams()
610
    {
611
        $gigyaResponse = $this->setupCall(
612
            'accounts.getAccountInfo',
613
            'https://accounts.eu1.gigya.com/accounts.getAccountInfo',
614
            [
615
                'auth'        => 'gigya',
616
                'verify'      => $this->certPath,
617
                'form_params' => [
618
                    'secret' => 'newSecret',
619
                ],
620
            ]
621
        );
622
        $client = $this->createClient();
623
624
        $result = $client->accounts()->getAccountInfo(
625
            ['secret' => 'newSecret']
626
        );
627
628
        static::assertSame($gigyaResponse, $result);
629
    }
630
631
    public function testCallingAChainWillCallThatChain()
632
    {
@@ 631-651 (lines=21) @@
628
        static::assertSame($gigyaResponse, $result);
629
    }
630
631
    public function testCallingAChainWillCallThatChain()
632
    {
633
        $gigyaResponse = $this->setupCall(
634
            'accounts.getAccountInfo',
635
            'https://fidm.eu1.gigya.com/fidm.saml.idp.getConfig',
636
            [
637
                'auth'        => 'gigya',
638
                'verify'      => $this->certPath,
639
                'form_params' => [
640
                    'secret' => 'newSecret',
641
                ],
642
            ]
643
        );
644
        $client = $this->createClient();
645
646
        $result = $client->fidm()->{'saml.idp.getConfig'}(
647
            ['secret' => 'newSecret']
648
        );
649
650
        static::assertSame($gigyaResponse, $result);
651
    }
652
653
    public function testWillCallAValidator()
654
    {