public function testSetStatuses() { $ok = $this->object->setFeedStatuses('string1'); $this->assertNull($ok); $o = $this->object->getOptions(); $this->assertArrayHasKey('FeedProcessingStatusList.Status.1', $o); $this->assertEquals('string1', $o['FeedProcessingStatusList.Status.1']); $ok2 = $this->object->setFeedStatuses(array('string1', 'string2')); $this->assertNull($ok2); $o2 = $this->object->getOptions(); $this->assertArrayHasKey('FeedProcessingStatusList.Status.1', $o2); $this->assertArrayHasKey('FeedProcessingStatusList.Status.2', $o2); $this->assertEquals('string1', $o2['FeedProcessingStatusList.Status.1']); $this->assertEquals('string2', $o2['FeedProcessingStatusList.Status.2']); $this->object->setFeedStatuses('stringx'); $o3 = $this->object->getOptions(); $this->assertArrayNotHasKey('FeedProcessingStatusList.Status.2', $o3); $this->assertFalse($this->object->setFeedStatuses(null)); }
/** * 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(); } }