]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - tests/unit/lib/PageListTest.php
php_closing_tag [PSR-2] The closing ?> tag MUST be omitted from files containing...
[SourceForge/phpwiki.git] / tests / unit / lib / PageListTest.php
1 <?php
2
3 require_once 'lib/PageList.php';
4 require_once 'PHPUnit.php';
5
6 class PageListTest extends phpwiki_TestCase {
7
8     function testPageList() {
9         // Completely empty PageList
10         $columns = "";
11         $exclude = "";
12         $options = "";
13         $pl = new PageList($columns, $exclude, $options);
14         $this->assertTrue($pl->isEmpty(), "empty");
15         $this->assertEquals(0, $pl->getTotal(), "count 0");
16         $cap = $pl->getCaption();
17         $this->assertTrue(empty($cap), "empty caption");
18
19         // PageList sorting
20         $columns[] = 'pagename';
21         $pl = new PageList($columns, $exclude, $options);
22         //global $request;
23         $pl->addPage("foo");
24         $pl->addPage("blarg");
25         $this->assertEquals(2, $pl->getTotal(), "count 2");
26         //print_r($pl->getContent());
27     }
28 }