本文整理汇总了PHP中Zend_Service_Ebay_Finding类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Service_Ebay_Finding类的具体用法?PHP Zend_Service_Ebay_Finding怎么用?PHP Zend_Service_Ebay_Finding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Service_Ebay_Finding类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
public function testConstructor()
{
$this->assertEquals('EBAY-US', $this->_finding->getOption(Zend_Service_Ebay_Finding::OPTION_GLOBAL_ID));
$this->assertEquals('foo', $this->_finding->getOption(Zend_Service_Ebay_Finding::OPTION_APP_ID));
$options = array(Zend_Service_Ebay_Finding::OPTION_APP_ID => 'app-id', Zend_Service_Ebay_Finding::OPTION_GLOBAL_ID => 'EBAY-GB', 'foo' => 'bar');
$finding = new Zend_Service_Ebay_Finding($options);
$this->assertEquals('EBAY-GB', $finding->getOption(Zend_Service_Ebay_Finding::OPTION_GLOBAL_ID));
$this->assertEquals('app-id', $finding->getOption(Zend_Service_Ebay_Finding::OPTION_APP_ID));
$this->assertEquals('bar', $finding->getOption('foo'));
$this->setExpectedException('Zend_Service_Ebay_Finding_Exception');
$finding = new Zend_Service_Ebay_Finding(array('foo' => 'bar'));
}
示例2: testItemsPagination
public function testItemsPagination()
{
// page 1
// make sure this search will generate more than one page as result
$page1 = $this->_finding->findItemsByKeywords('laptop');
$this->assertEquals(1, $page1->paginationOutput->pageNumber);
// out of range, page #0
try {
$page1->page($this->_finding, 0);
$this->fail('No exception found for page #0');
} catch (Exception $e) {
$this->assertTrue($e instanceof Zend_Service_Ebay_Finding_Exception);
$this->assertContains('Page number ', $e->getMessage());
}
// out of range, one page after last one
try {
$number = $page1->paginationOutput->totalPages + 1;
$page1->page($this->_finding, $number);
$this->fail("No exception found for page out of range #{$number}");
} catch (Exception $e) {
$this->assertTrue($e instanceof Zend_Service_Ebay_Finding_Exception);
$this->assertContains('Page number ', $e->getMessage());
}
// page next
$page2 = $page1->pageNext($this->_finding);
$this->assertEquals(2, $page2->paginationOutput->pageNumber);
// previous
$previous = $page2->pagePrevious($this->_finding);
$this->assertEquals(1, $previous->paginationOutput->pageNumber);
$this->assertNull($page1->pagePrevious($this->_finding));
// first
$first = $page2->pageFirst($this->_finding);
$this->assertEquals(1, $first->paginationOutput->pageNumber);
// last
$last = $page2->pageLast($this->_finding);
$this->assertNotEquals(1, $last->paginationOutput->pageNumber);
// page #2
$some = $page1->page($this->_finding, 2);
$this->assertEquals(2, $some->paginationOutput->pageNumber);
}
示例3: findItemsByProduct
/**
* @param Zend_Service_Ebay_Finding $proxy
* @param Zend_Config|array $options
* @return Zend_Service_Ebay_Finding_Response_Items
*/
public function findItemsByProduct(Zend_Service_Ebay_Finding $proxy, $options = null)
{
$type = $this->attributes('productId', 'type');
return $proxy->findItemsByProduct($this->productId, $type, $options);
}
示例4: _initXPath
/**
* Load DOMXPath for current DOM object.
*
* @see Zend_Service_Ebay_Finding::_parseResponse()
* @return void
*/
protected function _initXPath()
{
$document = $this->_dom->ownerDocument;
if (!isset($document->ebayFindingXPath)) {
$xpath = new DOMXPath($document);
foreach (Zend_Service_Ebay_Finding::getXmlNamespaces() as $alias => $uri) {
$xpath->registerNamespace($alias, $uri);
}
$document->ebayFindingXPath = $xpath;
}
$this->_xPath = $document->ebayFindingXPath;
}
示例5: findItems
/**
* @param Zend_Service_Ebay_Finding $proxy
* @param Zend_Config|array $options
* @return Zend_Service_Ebay_Finding_Response_Items
*/
public function findItems(Zend_Service_Ebay_Finding $proxy, $options = null)
{
return $proxy->findItemsInEbayStores($this->storeName, $options);
}
示例6: findItems
/**
* @param Zend_Service_Ebay_Finding $proxy
* @param Zend_Config|array $options
* @return Zend_Service_Ebay_Finding_Response_Items
*/
public function findItems(Zend_Service_Ebay_Finding $proxy, $options = null)
{
return $proxy->findItemsByCategory($this->categoryId, $options);
}