public function testFetchFeedResult() { resetLog(); $this->object->setMock(true, 'fetchFeedResult.xml'); $this->assertFalse($this->object->fetchFeedResult()); //no ID set yet $this->object->setFeedId(77); $ok = $this->object->fetchFeedResult(); $this->assertNull($ok); $check = parseLog(); $this->assertEquals('Single Mock File set: fetchFeedResult.xml', $check[1]); $this->assertEquals('Feed Submission ID must be set in order to fetch it!', $check[2]); $this->assertEquals('Fetched Mock File: mock/fetchFeedResult.xml', $check[3]); return $this->object; }
/** * This function will get the processing results of a feed previously sent to Amazon and give the data. * In order to do this, a feed ID is required. The response is in XML. */ function getFeedResult($feedId) { try { $amz = new AmazonFeedResult("myStore", $feedId); //feed ID can be quickly set by passing it to the constructor $amz->setFeedId($feedId); //otherwise, it must be set this way $amz->fetchFeedResult(); return $amz->getRawFeed(); } catch (\Exception $ex) { echo 'There was a problem with the Amazon library. Error: ' . $ex->getMessage(); } }