Exemplo n.º 1
0
    public function testGetTopArtists()
    {
        try {
            $testing_response = $this->header . '<?xml version="1.0" encoding="UTF-8"?>
<tag tag="rock" count="785147">
<artist name="Red Hot Chili Peppers" count="5097" streamable="yes">
    <mbid>8bfac288-ccc5-448d-9573-c33ea2aa5c30</mbid>
    <url>http://www.last.fm/music/Red+Hot+Chili+Peppers</url>
    <thumbnail>http://static.last.fm/proposedimages/thumbnail/6/1274/447958.jpg</thumbnail>
    <image>http://static.last.fm/proposedimages/sidebar/6/1274/447958.jpg</image>
</artist>
<artist name="Foo Fighters" count="3566" streamable="yes">
    <mbid>67f66c07-6e61-4026-ade5-7e782fad3a5d</mbid>
    <url>http://www.last.fm/music/Foo+Fighters</url>
    <thumbnail>http://static.last.fm/proposedimages/thumbnail/6/1000062/458.jpg</thumbnail>
    <image>http://static.last.fm/proposedimages/sidebar/6/1000062/458.jpg</image>
</artist>
<artist name="Radiohead" count="3457" streamable="yes">
    <mbid>a74b1b7f-71a5-4011-9441-d0b5e4122711</mbid>
    <url>http://www.last.fm/music/Radiohead</url>
    <thumbnail>http://static.last.fm/proposedimages/thumbnail/6/979/453678.jpg</thumbnail>
    <image>http://static.last.fm/proposedimages/sidebar/6/979/453678.jpg</image>
</artist>
</tag>
';
            $as = new Zend_Service_Audioscrobbler(TRUE, $testing_response);
            $as->set('tag', 'Rock');
            $response = $as->tagGetTopArtists();
            $this->assertNotNull($response->artist);
            $this->assertEquals((string) $response['tag'], strtolower($as->get('tag')));
        } catch (Exception $e) {
            $this->fail("Exception: [" . $e->getMessage() . "] thrown by test");
        }
    }
Exemplo n.º 2
0
 public function testGetTopArtists()
 {
     try {
         $as = new Zend_Service_Audioscrobbler();
         $as->set('tag', 'Rock');
         $response = $as->tagGetTopArtists();
         $this->assertNotNull($response->artist);
         $this->assertEquals($response['tag'], strtolower($as->get('tag')));
     } catch (Exception $e) {
         $this->fail("Exception: [" . $e->getMessage() . "] thrown by test");
     }
 }