/** * Testing if Amazon service component can handle return values where the * item-list is empty (no results found) * * @group ZF-9547 */ public function testAmazonComponentHandlesEmptyBookResults() { $xml = file_get_contents(__DIR__ . "/_files/amazon-response-invalid.xml"); $dom = new \DOMDocument(); $dom->loadXML($xml); $result = new Amazon\ResultSet($dom); $this->setExpectedException('ZendService\\Amazon\\Exception\\ExceptionInterface'); $result->current(); }
/** * NOTICE error does not occur even if RequestThrottled error happen in totalPages method. */ public function testNoticeErrorDoesNotHappenInTotalPages() { $xml = file_get_contents(__DIR__ . '/_files/amazon-response-request-throttled-error.xml'); $dom = new \DOMDocument(); $dom->loadXML($xml); $result = new Amazon\ResultSet($dom); try { $result->totalPages(); } catch (\PHPUnit_Framework_Error_Notice $e) { $this->fail('totalResult method should not be occurred NOTICE error.'); } }