Completed
Push — master ( c1cb0e...ab58ed )
by Дмитрий
03:42
created

AbstractProviderTestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 23
ccs 14
cts 14
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A makeIdentityClientResponse() 0 20 1
1
<?php
2
/**
3
 * SocialConnect project
4
 * @author: Patsura Dmitry https://github.com/ovr <[email protected]>
5
 */
6
7
namespace Test\Providers;
8
9
use SocialConnect\Auth\Provider\Exception\InvalidAccessToken;
10
use SocialConnect\Auth\Consumer;
11
use SocialConnect\OAuth2\AccessToken;
12
use SocialConnect\Common\Http\Client\ClientInterface;
13
use Test\TestCase;
14
15
class AbstractProviderTestCase extends TestCase
16
{
17 1
    protected function makeIdentityClientResponse(array $responseData)
18
    {
19 1
        $mockedHttpClient = $this->getMockBuilder(\SocialConnect\Common\Http\Client\Curl::class)
20 1
            ->disableProxyingToOriginalMethods()
21 1
            ->getMock();
22
23 1
        $response = new \SocialConnect\Common\Http\Response(
24 1
            200,
25 1
            json_encode(
26
                $responseData
27 1
            ),
28 1
            []
29 1
        );
30
31 1
        $mockedHttpClient->expects($this->once())
32 1
            ->method('request')
33 1
            ->willReturn($response);
34
35 1
        return $mockedHttpClient;
36
    }
37
}
38