Passed
Pull Request — master (#11)
by Pol
02:31
created

RPDiscoveryWebFingerUnknownMember::getTestId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\OpenIDClient\ConformanceTest\RpTest\Discovery;
6
7
use PHPUnit\Framework\Assert;
8
use Facile\OpenIDClient\ConformanceTest\RpTest\AbstractRpTest;
9
use Facile\OpenIDClient\ConformanceTest\TestInfo;
10
use Facile\OpenIDClient\Issuer\IssuerBuilder;
11
12
/**
13
 * The webfinger response will contain a member that the client doesn't recognize.
14
 *
15
 * An issuer location should be returned.
16
 */
17
class RPDiscoveryWebFingerUnknownMember extends AbstractRpTest
18
{
19
20
    public function getTestId(): string
21
    {
22
        return 'rp-discovery-webfinger-unknown-member';
23
    }
24
25
    public function execute(TestInfo $testInfo): void
26
    {
27
        $input = $testInfo->getRoot() . '/' . $testInfo->getRpId() . '/' . $this->getTestId() . '/joe';
28
29
        $issuer = (new IssuerBuilder())
30
            ->build($input);
31
32
        $expected = sprintf('%s/%s/%s', $testInfo->getRoot(), $testInfo->getRpId(), $this->getTestId());
33
        Assert::assertSame($expected, $issuer->getMetadata()->getIssuer());
34
    }
35
}
36