public function testBadUserGetTopTagsForArtist() { try { $as = new Zend_Service_Audioscrobbler(); $response = $as->userGetTopTagsForArtist(); } catch (Exception $e) { return; } $this->fail("Function did not throw exception based on bad parameters"); }
/** * Ensures that userGetTopTagsForArtist() throws an exception when based on bad parameters * * @return void */ public function testBadUserGetTopTagsForArtist() { $testingResponse = "HTTP/1.1 200 OK\r\n" . "Content-type: text/xml\r\n" . "\r\n" . "ERROR: Missing 'subject' parameter in querystring"; $as = new Zend_Service_Audioscrobbler(true, $testingResponse); try { $response = $as->userGetTopTagsForArtist(); $this->fail('userGetTopTagsForArtist() did not throw exception based on bad parameters'); } catch (Zend_Service_Exception $e) { $this->assertContains('SimpleXML', $e->getMessage()); } }
public function testBadUserGetTopTagsForArtist() { try { $testing_response = "HTTP/1.1 200 OK\r\n" . "Content-type: text/xml\r\n" . "\r\n" . "ERROR: Missing 'subject' parameter in querystring"; $as = new Zend_Service_Audioscrobbler(TRUE, $testing_response); $response = $as->userGetTopTagsForArtist(); } catch (Exception $e) { return; } $this->fail("Function did not throw exception based on bad parameters"); }