Ejemplo n.º 1
0
 /**
  * @group ZF-9396
  */
 public function testArrayAccessInClassSerializableLimitIterator()
 {
     $iterator = new \ArrayIterator(array('zf9396', 'foo', null));
     $paginator = new Paginator\Paginator(new Adapter\Iterator($iterator));
     $this->assertEquals('zf9396', $paginator->getItem(1));
     $items = $paginator->getAdapter()->getItems(0, 10);
     $this->assertEquals('foo', $items[1]);
     $this->assertEquals(0, $items->key());
     $this->assertFalse(isset($items[2]));
     $this->assertTrue(isset($items[1]));
     $this->assertFalse(isset($items[3]));
 }
Ejemplo n.º 2
0
 /**
  * @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));
 }