public function test_clean_cdata_hu () { $data = get_fixture('rss_hu.xml'); $data = clean_cdata( $data ); $feed = new $this->model; $feed->load($data); }
public function testRequestCredentialsToken() { $expected = array('grant_type' => 'client_credentials', 'scope' => 'user-read-email'); $headers = array('Authorization' => 'Basic Yjc3NzI5MmFmMGRlZjIyZjkyNTc5OTFmYzc3MGI1MjA6NmEwNDE5ZjQzZDBhYTkzYjJhZTg4MTQyOWI2YjliYzI='); $return = array('body' => get_fixture('access-token')); $stub = $this->setupStub('POST', '/api/token', $expected, $headers, $return); $session = new SpotifyWebAPI\Session($this->clientID, $this->clientSecret, $this->redirectURI, $stub); $result = $session->requestCredentialsToken(array('user-read-email')); $this->assertTrue($result); $this->assertNotEmpty($session->getAccessToken()); $this->assertEquals(time() + 3600, $session->getTokenExpiration()); }
public function testUserFollowsPlaylist() { $options = array('ids' => array('74ASZWbe4lXaubB36ztrGX', '36QJpDe2go2KgaRleHCDTp')); $expected = array('ids' => '74ASZWbe4lXaubB36ztrGX,36QJpDe2go2KgaRleHCDTp'); $headers = array('Authorization' => 'Bearer ' . $this->accessToken); $return = array('body' => get_fixture('users-follows-playlist')); $stub = $this->setupStub('GET', '/v1/users/mcgurk/playlists/0UZ0Ll4HJHR7yvURYbHJe9/followers/contains', $expected, $headers, $return); $api = new SpotifyWebAPI\SpotifyWebAPI($stub); $api->setAccessToken($this->accessToken); $response = $api->userFollowsPlaylist('mcgurk', '0UZ0Ll4HJHR7yvURYbHJe9', $options); $this->assertTrue($response[0]); }