Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function testGetToken() |
||
22 | { |
||
23 | $mock = new MockHandler([ |
||
24 | new Response( |
||
25 | 200, |
||
26 | ['Content-Type' => 'application/json'], |
||
27 | json_encode(['token' => '1453720507']) |
||
28 | ), ] |
||
29 | ); |
||
30 | |||
31 | $handler = HandlerStack::create($mock); |
||
32 | |||
33 | $authClient = new Client([ |
||
34 | 'handler' => $handler, |
||
35 | ]); |
||
36 | |||
37 | $authStrategy = new QueryAuthStrategy(['username' => 'admin', 'password' => 'admin']); |
||
38 | |||
39 | $jwtManager = new JwtManager($authClient, $authStrategy); |
||
40 | $token = $jwtManager->getJwtToken(); |
||
41 | |||
42 | $this->assertInstanceOf(JwtToken::class, $token); |
||
43 | $this->assertEquals('1453720507', $token->getToken()); |
||
44 | } |
||
45 | } |
||
46 |