| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 25 | public function testGetAuthorizeUrl() |
||
| 26 | { |
||
| 27 | $redirectUrl = $this->session->getAuthorizeUrl(); |
||
| 28 | |||
| 29 | $this->assertNotEmpty($redirectUrl, 'authorize url from spotify is empty'); |
||
| 30 | $parseRedirectUrl = parse_url($redirectUrl); |
||
| 31 | $this->assertSame('accounts.spotify.com', $parseRedirectUrl['host']); |
||
| 32 | $this->assertSame('/authorize', $parseRedirectUrl['path']); |
||
| 33 | |||
| 34 | $this->assertNotEmpty($parseRedirectUrl['query']); |
||
| 35 | |||
| 36 | $info = []; |
||
| 37 | parse_str($parseRedirectUrl['query'], $info); |
||
| 38 | |||
| 39 | $this->assertSame('code', $info['response_type']); |
||
| 40 | $this->assertSame($_ENV['REDIRECT_URI'], $info['redirect_uri']); |
||
| 41 | $this->assertTrue(isset($info['client_id'])); |
||
| 42 | } |
||
| 51 |