StaticProviderTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testShouldReturnProvidedAuthorization() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\OAuth2\HttpClient\Test\Authorization;
6
7
use Facile\OAuth2\HttpClient\Authorization\StaticProvider;
8
use Facile\OAuth2\HttpClient\Request\OAuth2RequestInterface;
9
use Facile\OpenIDClient\Client\ClientInterface;
10
use PHPUnit\Framework\TestCase;
11
12
class StaticProviderTest extends TestCase
13
{
14
    public function testShouldReturnProvidedAuthorization(): void
15
    {
16
        $authorizationValue = 'Bearer foo';
17
        $client = $this->prophesize(ClientInterface::class);
18
        $request = $this->prophesize(OAuth2RequestInterface::class);
19
        $provider = new StaticProvider($authorizationValue);
20
21
        $this->assertSame($authorizationValue, $provider->getAuthorization($client->reveal(), $request->reveal()));
22
    }
23
}
24