public function testCreateUserPlaylist() { $options = array('name' => 'Test playlist', 'public' => false); $expected = json_encode($options); $headers = array('Authorization' => 'Bearer ' . $this->accessToken, 'Content-Type' => 'application/json'); $return = array('body' => get_fixture('user-playlist')); $stub = $this->setupStub('POST', '/v1/users/mcgurk/playlists', $expected, $headers, $return); $api = new SpotifyWebAPI\SpotifyWebAPI($stub); $api->setAccessToken($this->accessToken); $response = $api->createUserPlaylist('mcgurk', $options); $this->assertObjectHasAttribute('id', $response); }