public function testFetchFeedSubmissionsToken2() { resetLog(); $this->object->setMock(true, array('fetchFeedSubmissionsToken.xml', 'fetchFeedSubmissionsToken2.xml')); //with using token $this->object->setUseToken(); $ok = $this->object->fetchFeedSubmissions(); $this->assertNull($ok); $check = parseLog(); $this->assertEquals('Mock files array set.', $check[1]); $this->assertEquals('Fetched Mock File: mock/fetchFeedSubmissionsToken.xml', $check[2]); $this->assertEquals('Recursively fetching more Feeds', $check[3]); $this->assertEquals('Fetched Mock File: mock/fetchFeedSubmissionsToken2.xml', $check[4]); $this->assertFalse($this->object->hasToken()); $o = $this->object->getOptions(); $this->assertEquals('GetFeedSubmissionListByNextToken', $o['Action']); $r = $this->object->getFeedList(); $this->assertArrayHasKey(0, $r); $this->assertEquals('9876543210', $r[0]['FeedSubmissionId']); $this->assertEquals('_MOCK_FEED_', $r[0]['FeedType']); $this->assertEquals('2012-12-12T12:12:12+00:00', $r[0]['SubmittedDate']); $this->assertEquals('_SUBMITTED_', $r[0]['FeedProcessingStatus']); $this->assertEquals('1234567890', $r[1]['FeedSubmissionId']); $this->assertEquals('_MOCK_FEED_', $r[1]['FeedType']); $this->assertEquals('2012-12-12T12:12:12+00:00', $r[1]['SubmittedDate']); $this->assertEquals('_SUBMITTED_', $r[1]['FeedProcessingStatus']); }
/** * This function will retrieve a list of all items with quantity that was adjusted within the past 24 hours. * The entire list of items is returned, with each item contained in an array. * Note that this does not relay whether or not the feed had any errors. * To get this information, the feed's results must be retrieved. */ function getAmazonFeedStatus() { require '../includes/classes.php'; //autoload classes, not needed if composer is being used try { $amz = new AmazonFeedList("myStore"); $amz->setTimeLimits('- 24 hours'); //limit time frame for feeds to any updated since the given time $amz->setFeedStatuses(array("_SUBMITTED_", "_IN_PROGRESS_", "_DONE_")); //exclude cancelled feeds $amz->fetchFeedSubmissions(); //this is what actually sends the request return $amz->getFeedList(); } catch (Exception $ex) { echo 'There was a problem with the Amazon library. Error: ' . $ex->getMessage(); } }