本文整理汇总了PHP中parseLog函数的典型用法代码示例。如果您正苦于以下问题:PHP parseLog函数的具体用法?PHP parseLog怎么用?PHP parseLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parseLog函数的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: test/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: addLogToTable
function addLogToTable()
{
// Получаем коннект с базой и вставляем данные
$db = new pgDB();
if ($db->insertArray(parseLog())) {
echo 'Данные успешно добавлены в базу данных!';
}
}
示例3: 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]);
}
示例4: testSaveReport
/**
* @depends testFetchReport
*/
public function testSaveReport($o)
{
$path = __DIR__ . '/../../mock/saveReport.xml';
$path2 = __DIR__ . '/../../mock/fetchReport.xml';
$o->saveReport($path);
$check = parseLog();
$this->assertEquals("Successfully saved report #777 at {$path}", $check[1]);
$this->assertFileEquals($path2, $path);
$this->assertFalse($this->object->saveReport('here'));
//not fetched yet for this object
}
示例5: 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]);
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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: test/mock/fetchTrackingDetails.xml', $check[3]);
return $this->object;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: testFetchInventoryListToken2
public function testFetchInventoryListToken2()
{
resetLog();
$this->object->setMock(true, array('fetchInventoryListToken.xml', 'fetchInventoryListToken2.xml'));
//with using token
$this->object->setUseToken();
$this->assertNull($this->object->fetchInventoryList());
$check = parseLog();
$this->assertEquals('Mock files array set.', $check[1]);
$this->assertEquals('Fetched Mock File: mock/fetchInventoryListToken.xml', $check[2]);
$this->assertEquals('Recursively fetching more Inventory Supplies', $check[3]);
$this->assertEquals('Fetched Mock File: mock/fetchInventoryListToken2.xml', $check[4]);
$this->assertFalse($this->object->hasToken());
$o = $this->object->getOptions();
$this->assertEquals('ListInventorySupplyByNextToken', $o['Action']);
$this->assertArrayNotHasKey('QueryStartDateTime', $o);
$this->assertArrayNotHasKey('ResponseGroup', $o);
$r = $this->object->getSupply(null);
$this->assertArrayHasKey(0, $r);
$this->assertArrayHasKey(1, $r);
$this->assertEquals('SampleSKU1', $r[0]['SellerSKU']);
$this->assertEquals('SampleSKU2', $r[1]['SellerSKU']);
$this->assertEquals(2, count($r));
$this->assertNotEquals($r[0], $r[1]);
}
示例14: testFetchPreview
public function testFetchPreview()
{
resetLog();
$this->object->setMock(true, 'fetchPreview.xml');
$this->assertFalse($this->object->fetchPreview());
//no address set yet
$a = array();
$a['Name'] = 'Name';
$a['Line1'] = 'Line1';
$a['City'] = 'City';
$a['StateOrProvidenceCode'] = 'StateOrProvidenceCode';
$a['CountryCode'] = 'CountryCode';
$a['PostalCode'] = 'PostalCode';
$this->object->setAddress($a);
$this->assertFalse($this->object->fetchPreview());
//no items set yet
$i = array();
$i[0]['SellerSKU'] = 'SellerSKU';
$i[0]['SellerFulfillmentOrderItemId'] = 'SellerFulfillmentOrderItemId';
$i[0]['Quantity'] = 'Quantity';
$this->object->setItems($i);
$this->assertNull($this->object->fetchPreview());
$check = parseLog();
$this->assertEquals('Single Mock File set: fetchPreview.xml', $check[1]);
$this->assertEquals('Address must be set in order to create a preview', $check[2]);
$this->assertEquals('Items must be set in order to create a preview', $check[3]);
$this->assertEquals('Fetched Mock File: mock/fetchPreview.xml', $check[4]);
return $this->object;
}
示例15: testFetchMockResponse
public function testFetchMockResponse()
{
resetLog();
$this->object->setOrderId('777');
$this->object->setMock(true, array());
$this->assertFalse($this->object->cancelOrder());
//no mock response
$this->object->setMock(true, 'oopsafile.xml');
$this->assertFalse($this->object->cancelOrder());
//no strings allowed
$this->object->setMock(true, array(404, 503, 400, 200));
$this->assertFalse($this->object->cancelOrder());
//404
$this->assertFalse($this->object->cancelOrder());
//503
$this->assertFalse($this->object->cancelOrder());
//400
$this->assertTrue($this->object->cancelOrder());
//200
$this->assertFalse($this->object->cancelOrder());
//loop back to 404
$check = parseLog();
$this->assertEquals('Mock files array set.', $check[1]);
$this->assertEquals('Attempted to retrieve mock responses, but no mock responses present', $check[2]);
$this->assertEquals('No Response found', $check[3]);
$this->assertEquals('Mock Mode set to ON', $check[4]);
$this->assertEquals('Single Mock File set: oopsafile.xml', $check[5]);
$this->assertEquals('fetchMockResponse only works with response code numbers', $check[6]);
$this->assertEquals('No Response found', $check[7]);
$this->assertEquals('Mock Mode set to ON', $check[8]);
$this->assertEquals('Mock files array set.', $check[9]);
$this->assertEquals('Returning Mock Response: 404', $check[10]);
$this->assertEquals('Bad Response! 404 Not Found: Not Found - Not Found', $check[11]);
$this->assertEquals('Returning Mock Response: 503', $check[12]);
$this->assertEquals('Bad Response! 503 Service Unavailable: Service Unavailable - Service Unavailable', $check[13]);
$this->assertEquals('Returning Mock Response: 400', $check[14]);
$this->assertEquals('Bad Response! 400 Bad Request: Bad Request - Bad Request', $check[15]);
$this->assertEquals('Returning Mock Response: 200', $check[16]);
$this->assertEquals('Successfully deleted Fulfillment Order 777', $check[17]);
$this->assertEquals('End of Mock List, resetting to 0', $check[18]);
$this->assertEquals('Mock List index reset to 0', $check[19]);
$this->assertEquals('Returning Mock Response: 404', $check[20]);
$this->assertEquals('Bad Response! 404 Not Found: Not Found - Not Found', $check[21]);
}