本文整理汇总了PHP中Zend_Service_Ebay_Finding::findItemsByKeywords方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Service_Ebay_Finding::findItemsByKeywords方法的具体用法?PHP Zend_Service_Ebay_Finding::findItemsByKeywords怎么用?PHP Zend_Service_Ebay_Finding::findItemsByKeywords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Service_Ebay_Finding
的用法示例。
在下文中一共展示了Zend_Service_Ebay_Finding::findItemsByKeywords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}