Passed
Push — master ( eac606...788c0b )
by Alex
03:59
created

AdoptedBaseAuth   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 11
c 1
b 1
f 0
dl 0
loc 34
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTokenUri() 0 3 1
A getUserInfoUri() 0 3 1
A requestToken() 0 4 1
A getRequest() 0 7 1
A getOauthUri() 0 3 1
1
<?php
2
namespace Mezon\SocialNetwork\Auth\Tests;
3
4
use Mezon\SocialNetwork\BaseAuth;
5
6
class AdoptedBaseAuth extends BaseAuth
7
{
8
9
    public function getUserInfoUri(string $token = ''): string
10
    {
11
        return 'http://user-info-uri/?' . $token;
12
    }
13
14
    public function getTokenUri(): string
15
    {
16
        return 'http://token-uri';
17
    }
18
19
    public function getOauthUri(): string
20
    {
21
        return 'http://oauth-uri';
22
    }
23
24
    protected function getRequest(string $url): string
25
    {
26
        return json_encode([
27
            'id' => 1,
28
            'picture' => [
29
                'data' => [
30
                    'url' => 'http://'
31
                ]
32
            ]
33
        ]);
34
    }
35
36
    public function requestToken(array $params): array
37
    {
38
        return [
39
            'access_token' => 'some-token'
40
        ];
41
    }
42
}
43