コード例 #1
0
 public function testGetAlbums()
 {
     $albums = array('1oR3KrPIp4CbagPa3PhtPp', '6lPb7Eoon6QPbscWbMsk6a');
     $options = array('market' => 'SE');
     $expected = array('ids' => '1oR3KrPIp4CbagPa3PhtPp,6lPb7Eoon6QPbscWbMsk6a', 'market' => 'SE');
     $headers = array('Authorization' => 'Bearer ' . $this->accessToken);
     $return = array('body' => get_fixture('albums'));
     $stub = $this->setupStub('GET', '/v1/albums/', $expected, $headers, $return);
     $api = new SpotifyWebAPI\SpotifyWebAPI($stub);
     $api->setAccessToken($this->accessToken);
     $response = $api->getAlbums($albums, $options);
     $this->assertNotEmpty($response->albums);
 }