public function testUserGetTopTagsForAlbum() { try { $testing_response = "HTTP/1.1 200 OK\r\n" . "Content-type: text/xml\r\n" . "\r\n" . '<?xml version="1.0" encoding="UTF-8"?> <albumtags user="******" album="Ride the Lightning" artist="Metallica"> </albumtags>'; $as = new Zend_Service_Audioscrobbler(true, $testing_response); $as->set('user', 'RJ'); $as->set('artist', 'Metallica'); $as->set('album', 'Ride The Lightning'); $response = $as->userGetTopTagsForAlbum(); $this->assertEquals((string) $response['user'], 'RJ'); $this->assertEquals((string) strtolower($response['artist']), strtolower('Metallica')); $this->assertEquals((string) strtolower($response['album']), strtolower('Ride The Lightning')); } catch (Exception $e) { $this->fail("Exception: [" . $e->getMessage() . "] thrown by test"); } }
public function testUserGetTopTagsForAlbum() { try { $as = new Zend_Service_Audioscrobbler(); $as->set('user', 'RJ'); $as->set('artist', 'Metallica'); $as->set('album', 'Ride The Lightning'); $response = $as->userGetTopTagsForAlbum(); $this->assertEquals($response['user'], 'RJ'); $this->assertEquals(strtolower($response['artist']), strtolower('Metallica')); $this->assertEquals(strtolower($response['album']), strtolower('Ride The Lightning')); $this->assertNotNull($response->albumtags); } catch (Exception $e) { $this->fail("Exception: [" . $e->getMessage() . "] thrown by test"); } }