当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Service_Ebay_Finding::findItemsByKeywords方法代码示例

本文整理汇总了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);
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:40,代码来源:OnlineTest.php


注:本文中的Zend_Service_Ebay_Finding::findItemsByKeywords方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。