| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function testCreateRequest(): void |
||
| 23 | { |
||
| 24 | $auth = new SelfSignedTLSClientAuth(); |
||
| 25 | |||
| 26 | $stream = $this->prophesize(StreamInterface::class); |
||
| 27 | $request = $this->prophesize(RequestInterface::class); |
||
| 28 | $client = $this->prophesize(ClientInterface::class); |
||
| 29 | $metadata = $this->prophesize(ClientMetadataInterface::class); |
||
| 30 | |||
| 31 | $client->getMetadata()->willReturn($metadata->reveal()); |
||
| 32 | $metadata->getClientId()->willReturn('foo'); |
||
| 33 | $metadata->getClientSecret()->shouldNotBeCalled(); |
||
| 34 | |||
| 35 | $stream->write('foo=bar&client_id=foo')->shouldBeCalled(); |
||
| 36 | |||
| 37 | $request->getBody()->willReturn($stream->reveal()); |
||
| 38 | |||
| 39 | $result = $auth->createRequest( |
||
| 40 | $request->reveal(), |
||
| 41 | $client->reveal(), |
||
| 42 | ['foo' => 'bar'] |
||
| 43 | ); |
||
| 44 | |||
| 45 | static::assertSame($request->reveal(), $result); |
||
| 46 | } |
||
| 48 |