File: PageListTest.php

package info (click to toggle)
phpwiki 1.3.12p3-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 16,956 kB
  • ctags: 21,608
  • sloc: php: 82,335; xml: 3,840; sh: 1,522; sql: 1,198; perl: 625; makefile: 562; awk: 28
file content (31 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

require_once 'lib/PageList.php';
require_once 'PHPUnit.php';

class PageListTest extends phpwiki_TestCase {

    function testPageList() {
        // Completely empty PageList
        $columns = "";
        $exclude = "";
        $options = "";
        $pl = new PageList($columns, $exclude, $options);
        $this->assertTrue($pl->isEmpty(), "empty");
        $this->assertEquals(0, $pl->getTotal(), "count 0");
        $cap = $pl->getCaption();
        $this->assertTrue(empty($cap), "empty caption");

        // PageList sorting
        $columns[] = 'pagename';
        $pl = new PageList($columns, $exclude, $options);
        //global $request;
        $pl->addPage("foo");
        $pl->addPage("blarg");
        $this->assertEquals(2, $pl->getTotal(), "count 2");
        //print_r($pl->getContent());
    }
}


?>