Пример #1
0
 /**
  * @covers Opc_Paginator
  */
 public function testBaseClass()
 {
     $opc = new Opc_Class();
     $this->assertEquals(false, Opc_Paginator::getDecoratorClassName('test'));
     Opc_Paginator::registerDecorator('test', 'TestClass');
     $this->assertEquals('TestClass', Opc_Paginator::getDecoratorClassName('test'));
     $this->assertEquals(0, Opc_Paginator::countOffset(0, 10));
     $this->assertEquals(0, Opc_Paginator::countOffset(1, 10));
     $this->assertEquals(10, Opc_Paginator::countOffset(2, 10));
     $this->assertEquals(new Opc_Paginator_Range(1000, 10), Opc_Paginator::create(1000, 10));
 }
Пример #2
0
 /**
  * @return array
  */
 public function current()
 {
     $current = $this->get('decorator')->current();
     if (isset($current['number'])) {
         $current['offset'] = Opc_Paginator::countOffset($current['number'], $this->get('limit'));
     }
     return $current;
 }