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 TestOfPagerNoData extends UnitTestCase {
8
    var $pager;
9
    function TestOfPagerNoData($name='Test of Pager - no data') {
10
        $this->UnitTestCase($name);
11
    }
12
    function setUp() {
13
        $options = array(
14
            'totalItems' => 0,
15
            'perPage'    => 5,
16
            'mode'       => 'Sliding',
17
        );
18
        $this->pager = Pager::factory($options);
19
    }
20
    function tearDown() {
21
        unset($this->pager);
22
    }
23
    function testCurrentPageID () {
24
        $this->assertEqual(0, $this->pager->getCurrentPageID());
25
    }
26
    function testNextPageID () {
27
        $this->assertEqual(false, $this->pager->getNextPageID());
28
    }
29
    function testPrevPageID () {
30
        $this->assertEqual(false, $this->pager->getPreviousPageID());
31
    }
32
    function testNumItems () {
33
        $this->assertEqual(0, $this->pager->numItems());
34
    }
35
    function testNumPages () {
36
        $this->assertEqual(0, $this->pager->numPages());
37
    }
38
    function testFirstPage () {
39
        $this->assertEqual(true, $this->pager->isFirstPage());
40
    }
41
    function testLastPage () {
42
        $this->assertEqual(true, $this->pager->isLastPage());
43
    }
44
    function testLastPageComplete () {
45
        $this->assertEqual(true, $this->pager->isLastPageComplete());
46
    }
47
}
48
?>