Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
848 florian 1
<?php
2
// $Id$
3
 
4
require_once 'simple_include.php';
5
require_once 'pager_include.php';
6
 
7
class TestOfPagerJumpingNoData extends UnitTestCase {
8
    var $pager;
9
    function TestOfPagerJumpingNoData($name='Test of Pager_Jumping - no data') {
10
        $this->UnitTestCase($name);
11
    }
12
    function setUp() {
13
        $options = array(
14
            'totalItems' => 0,
15
            'perPage'  => 2,
16
            'mode'     => 'Jumping',
17
        );
18
        $this->pager = Pager::factory($options);
19
    }
20
    function tearDown() {
21
        unset($this->pager);
22
    }
23
    function testOffsetByPageId() {
24
        $this->assertEqual(array(1, 0), $this->pager->getOffsetByPageId());
25
    }
26
    function testPageIdByOffset() {
27
        $this->assertEqual(false, $this->pager->getPageIdByOffset(0));
28
    }
29
    function testPageIdByOffset2() {
30
        $this->assertEqual(1, $this->pager->getPageIdByOffset(1));
31
    }
32
    function testPageIdByOffset3() {
33
        $this->assertEqual(1, $this->pager->getPageIdByOffset(2));
34
    }
35
}
36
?>