Example #1
0
 public function testThrowsExceptionWhenRetrievingNonexistentItemFromLastPage()
 {
     try {
         $this->_paginator->getItem(10, 11);
     } catch (Exception $e) {
         $this->assertType('Zend_Paginator_Exception', $e);
         $this->assertContains('Page 11 does not contain item number 10', $e->getMessage());
     }
 }
 public function testGetNonExistingItemFromLastPage()
 {
     $this->_restorePaginatorDefaults();
     try {
         $this->_paginator->getItem(10, 11);
     } catch (Exception $e) {
         $this->assertType('Zend_Paginator_Exception', $e);
         $this->assertContains('Page 11 does not contain item number 10', $e->getMessage());
     }
 }
 /**
  * @group ZF-5427
  */
 public function testNegativeItemNumbers()
 {
     $this->assertEquals(10, $this->_paginator->getItem(-1, 1));
     $this->assertEquals(9, $this->_paginator->getItem(-2, 1));
     $this->assertEquals(101, $this->_paginator->getItem(-1, -1));
 }