1 | <?php |
||
30 | final class NoneAuthenticationMethodTest extends TestCase |
||
31 | { |
||
32 | /** |
||
33 | * @test |
||
34 | */ |
||
35 | public function genericCalls() |
||
36 | { |
||
37 | $method = new None(); |
||
38 | |||
39 | self::assertEquals([], $method->getSchemesParameters()); |
||
40 | self::assertEquals(['none'], $method->getSupportedMethods()); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @test |
||
45 | */ |
||
46 | public function theClientIdCannotBeFoundInTheRequest() |
||
47 | { |
||
48 | $method = new None(); |
||
49 | $request = $this->buildRequest([]); |
||
50 | |||
51 | $clientId = $method->findClientIdAndCredentials($request->reveal(), $credentials); |
||
52 | self::assertNull($clientId); |
||
53 | self::assertNull($credentials); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @test |
||
58 | */ |
||
59 | public function theClientIdHasBeenFoundInTheRequest() |
||
60 | { |
||
61 | $method = new None(); |
||
62 | $request = $this->buildRequest(['client_id' => 'CLIENT_ID']); |
||
63 | |||
64 | $clientId = $method->findClientIdAndCredentials($request->reveal(), $credentials); |
||
65 | self::assertInstanceOf(ClientId::class, $clientId); |
||
66 | self::assertNull($credentials); |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @test |
||
71 | */ |
||
72 | public function theClientIsAuthenticated() |
||
85 | |||
86 | /** |
||
87 | * @test |
||
88 | */ |
||
89 | public function theClientConfigurationCanBeChecked() |
||
97 | |||
98 | private function buildRequest(array $data): ObjectProphecy |
||
99 | { |
||
100 | $body = $this->prophesize(StreamInterface::class); |
||
110 | } |
||
111 |