Esempio n. 1
0
 public function testGetTopTags()
 {
     try {
         $testing_response = $this->header . '<?xml version="1.0" encoding="UTF-8"?>
                             <toptags artist="Metallica" track="Enter Sandman">
                             <tag>
                                 <name>metal</name> 
                                 <count>100</count>
                                 <url>http://www.last.fm/tag/metal</url>
                             </tag>
                             <tag>
                                 <name>heavy metal</name> 
                                 <count>55</count>
                                 <url>http://www.last.fm/tag/heavy%20metal</url>
                             </tag>
                             <tag>
                                 <name>rock</name> 
                                 <count>21</count>
                                 <url>http://www.last.fm/tag/rock</url>
                             </tag>
                             </toptags>
                             ';
         $as = new Zend_Service_Audioscrobbler(TRUE, $testing_response);
         $as->set('artist', 'Metallica');
         $as->set('track', 'Enter Sandman');
         $response = $as->trackGetTopTags();
         $this->assertNotNull(count($response->tag));
         $this->assertEquals((string) $response['artist'], 'Metallica');
         $this->assertEquals((string) $response['track'], 'Enter Sandman');
     } catch (Exception $e) {
         $this->fail("Exception: [" . $e->getMessage() . "] thrown by test");
     }
 }
Esempio n. 2
0
 public function testGetTopTags()
 {
     try {
         $as = new Zend_Service_Audioscrobbler();
         $as->set('artist', 'Metallica');
         $as->set('track', 'Enter Sandman');
         $response = $as->trackGetTopTags();
         $this->assertNotNull($response->tag);
         $this->assertEquals($response['artist'], 'Metallica');
         $this->assertEquals($response['track'], 'Enter Sandman');
     } catch (Exception $e) {
         $this->fail("Exception: [" . $e->getMessage() . "] thrown by test");
     }
 }