本文整理汇总了PHP中resetLog函数的典型用法代码示例。如果您正苦于以下问题:PHP resetLog函数的具体用法?PHP resetLog怎么用?PHP resetLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resetLog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSubmitFeed
public function testSubmitFeed()
{
resetLog();
$this->object->setMock(true, 'submitFeed.xml');
$this->assertFalse($this->object->submitFeed());
//nothing set yet
$this->assertFalse($this->object->getResponse());
//no response yet either
$this->object->setFeedContent('yes');
$this->assertFalse($this->object->submitFeed());
//no feed type set yet
$this->object->setFeedType('_MOCK_FEED_');
$ok = $this->object->submitFeed();
//now it is good
$this->assertNull($ok);
$check = parseLog();
$this->assertEquals('Single Mock File set: submitFeed.xml', $check[1]);
$this->assertEquals('Feed\'s contents must be set in order to submit it!', $check[2]);
$this->assertEquals('Feed Type must be set in order to submit a feed!', $check[3]);
$this->assertEquals('Fetched Mock File: mock/submitFeed.xml', $check[4]);
$this->assertEquals('Successfully submitted feed #1234567890 (_MOCK_FEED_)', $check[5]);
$o = $this->object->getOptions();
$this->assertEquals('SubmitFeed', $o['Action']);
$r = $this->object->getResponse();
$this->assertInternalType('array', $r);
$this->assertArrayHasKey('FeedSubmissionId', $r);
$this->assertEquals('1234567890', $r['FeedSubmissionId']);
$this->assertArrayHasKey('FeedType', $r);
$this->assertEquals('_MOCK_FEED_', $r['FeedType']);
$this->assertArrayHasKey('SubmittedDate', $r);
$this->assertEquals('2012-12-12T12:12:12+00:00', $r['SubmittedDate']);
$this->assertArrayHasKey('FeedProcessingStatus', $r);
$this->assertEquals('_SUBMITTED_', $r['FeedProcessingStatus']);
}
示例2: testSaveFeed
/**
* @depends testFetchFeedResult
*/
public function testSaveFeed($o)
{
resetLog();
$this->assertFalse($this->object->saveFeed('mock/saveFeed.xml'));
//nothing yet
$o->saveFeed(__DIR__ . '/../../mock/saveFeed.xml');
$check = parseLog();
$this->assertEquals('Successfully saved feed #77 at ' . __DIR__ . '/../../mock/saveFeed.xml', $check[0]);
}
示例3: testSetStore
/**
* @covers AmazonCore::setStore
* @todo Implement testSetStore().
*/
public function testSetStore()
{
$this->object->setStore('no');
$check = parseLog();
$this->assertEquals('Mock Mode set to ON', $check[0]);
$this->assertEquals('Store no does not exist!', $check[1]);
resetLog();
$this->object->setStore('bad');
$bad = parseLog();
$this->assertEquals('Merchant ID is missing!', $bad[0]);
$this->assertEquals('Access Key ID is missing!', $bad[1]);
$this->assertEquals('Secret Key is missing!', $bad[2]);
}
示例4: testAcknowledgeReports
public function testAcknowledgeReports()
{
resetLog();
$this->object->setMock(true, 'acknowledgeReports.xml');
$this->assertFalse($this->object->acknowledgeReports());
//no Report ID set yet
$this->object->setReportIds('123456');
$this->assertNull($this->object->acknowledgeReports());
$check = parseLog();
$this->assertEquals('Single Mock File set: acknowledgeReports.xml', $check[1]);
$this->assertEquals('Report IDs must be set in order to acknowledge reports!', $check[2]);
$this->assertEquals('Fetched Mock File: mock/acknowledgeReports.xml', $check[3]);
return $this->object;
}
示例5: testSearchProducts
public function testSearchProducts()
{
resetLog();
$this->object->setMock(true, 'searchProducts.xml');
$this->assertFalse($this->object->searchProducts());
//no query yet
$this->object->setQuery('platinum');
$this->assertNull($this->object->searchProducts());
$o = $this->object->getOptions();
$this->assertEquals('ListMatchingProducts', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: searchProducts.xml', $check[1]);
$this->assertEquals('Search Query must be set in order to search for a query!', $check[2]);
$this->assertEquals('Fetched Mock File: mock/searchProducts.xml', $check[3]);
return $this->object;
}
示例6: testFetchServiceStatus
public function testFetchServiceStatus()
{
resetLog();
$this->object->setMock(true, 'fetchServiceStatus.xml');
$this->assertFalse($this->object->fetchServiceStatus());
//no service set yet
$this->object->setService('Inbound');
$this->assertNull($this->object->fetchServiceStatus());
//now it is good
$o = $this->object->getOptions();
$this->assertEquals('GetServiceStatus', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: fetchServiceStatus.xml', $check[1]);
$this->assertEquals('Service must be set in order to retrieve status', $check[2]);
$this->assertEquals('Fetched Mock File: mock/fetchServiceStatus.xml', $check[3]);
return $this->object;
}
示例7: testFetchTrackingDetails
public function testFetchTrackingDetails()
{
resetLog();
$this->object->setMock(true, 'fetchTrackingDetails.xml');
$this->assertFalse($this->object->fetchTrackingDetails());
//no package ID set yet
$this->object->setPackageNumber('777');
$ok = $this->object->fetchTrackingDetails();
//now it is good
$this->assertNull($ok);
$o = $this->object->getOptions();
$this->assertEquals('GetPackageTrackingDetails', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: fetchTrackingDetails.xml', $check[1]);
$this->assertEquals('Package Number must be set in order to fetch it!', $check[2]);
$this->assertEquals('Fetched Mock File: mock/fetchTrackingDetails.xml', $check[3]);
return $this->object;
}
示例8: testFetchReport
public function testFetchReport()
{
resetLog();
$this->object->setMock(true, 'fetchReport.xml');
$this->assertFalse($this->object->fetchReport());
//no report ID set yet
$this->object->setReportId('777');
$ok = $this->object->fetchReport();
//now it is good
$this->assertNull($ok);
$o = $this->object->getOptions();
$this->assertEquals('GetReport', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: fetchReport.xml', $check[1]);
$this->assertEquals('Report ID must be set in order to fetch it!', $check[2]);
$this->assertEquals('Fetched Mock File: mock/fetchReport.xml', $check[3]);
return $this->object;
}
示例9: testFetchOrder
public function testFetchOrder()
{
resetLog();
$this->object->setMock(true, 'fetchOrder.xml');
$this->assertFalse($this->object->fetchOrder());
//no order ID set yet
$this->object->setOrderId('058-1233752-8214740');
$this->assertNull($this->object->fetchOrder());
//now it is good
$o = $this->object->getOptions();
$this->assertEquals('GetOrder', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: fetchOrder.xml', $check[1]);
$this->assertEquals('Order ID must be set in order to fetch it!', $check[2]);
$this->assertEquals('Fetched Mock File: mock/fetchOrder.xml', $check[3]);
$get = $this->object->getData();
$this->assertInternalType('array', $get);
return $this->object;
}
示例10: testManageReportSchedule
public function testManageReportSchedule()
{
resetLog();
$this->object->setMock(true, 'manageReportSchedule.xml');
$this->assertFalse($this->object->manageReportSchedule());
//no report type yet
$this->object->setReportType('_GET_ORDERS_DATA_');
$this->assertFalse($this->object->manageReportSchedule());
//no report schedule yet
$this->object->setSchedule('_30_DAYS_');
$this->assertNull($this->object->manageReportSchedule());
$o = $this->object->getOptions();
$this->assertEquals('ManageReportSchedule', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: manageReportSchedule.xml', $check[1]);
$this->assertEquals('Report Type must be set in order to manage a report schedule!', $check[2]);
$this->assertEquals('Schedule must be set in order to manage a report schedule!', $check[3]);
$this->assertEquals('Fetched Mock File: mock/manageReportSchedule.xml', $check[4]);
return $this->object;
}
示例11: testFetchProductList
public function testFetchProductList()
{
resetLog();
$this->object->setMock(true, 'fetchProductList.xml');
$this->assertFalse($this->object->fetchProductList());
//no IDs yet
$this->object->setProductIds('789');
$this->assertFalse($this->object->fetchProductList());
//no ID type yet
$this->object->setIdType('ASIN');
$this->assertNull($this->object->fetchProductList());
$o = $this->object->getOptions();
$this->assertEquals('GetMatchingProductForId', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: fetchProductList.xml', $check[1]);
$this->assertEquals('Product IDs must be set in order to fetch them!', $check[2]);
$this->assertEquals('ID Type must be set in order to use the given IDs!', $check[3]);
$this->assertEquals('Fetched Mock File: mock/fetchProductList.xml', $check[4]);
return $this->object;
}
示例12: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
resetLog();
$this->object = new AmazonParticipationList('testStore', true, null, __DIR__ . '/../test-config.php');
}
示例13: testCancelFeeds
public function testCancelFeeds()
{
resetLog();
$this->object->setMock(true, 'cancelFeeds.xml');
$this->assertFalse($this->object->getFeedCount());
//not fetched yet
$ok = $this->object->cancelFeeds();
$this->assertNull($ok);
$check = parseLog();
$this->assertEquals('Single Mock File set: cancelFeeds.xml', $check[1]);
$this->assertEquals('Fetched Mock File: mock/cancelFeeds.xml', $check[2]);
$this->assertEquals('Successfully cancelled 1 report requests.', $check[3]);
$o = $this->object->getOptions();
$this->assertEquals('CancelFeedSubmissions', $o['Action']);
$count = $this->object->getFeedCount();
$this->assertEquals('1', $count);
}
示例14: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
resetLog();
$this->object = new AmazonOrder('testStore', null, null, true, null, __DIR__ . '/../test-config.php');
}
示例15: testRequestReport
public function testRequestReport()
{
resetLog();
$this->object->setMock(true, 'requestReport.xml');
$this->assertFalse($this->object->requestReport());
$this->object->setReportType('Type');
$this->assertNull($this->object->requestReport());
$o = $this->object->getOptions();
$this->assertEquals('RequestReport', $o['Action']);
$check = parseLog();
$this->assertEquals('Single Mock File set: requestReport.xml', $check[1]);
$this->assertEquals('Report Type must be set in order to request a report!', $check[2]);
$this->assertEquals('Fetched Mock File: mock/requestReport.xml', $check[3]);
return $this->object;
}