File: pager_post_test_simple.php

package info (click to toggle)
php-pager 2.4.8-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 340 kB
  • ctags: 795
  • sloc: php: 2,764; xml: 686; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 1,245 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
<?php
// $Id: pager_post_test_simple.php,v 1.1 2008/03/26 22:18:31 quipo Exp $

require_once 'simple_include.php';
require_once 'pager_include.php';

class TestOfPagerPOSTsimple extends UnitTestCase {
    var $pager;
    var $baseurl;
    var $options = array();

    function TestOfPagerPOSTsimple($name='Test of Pager with httpMethod="POST" - no web') {
        $this->UnitTestCase($name);
    }
    function setUp() {
        $this->options = array(
            'itemData' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
            'perPage'  => 1,
            'clearIfVoid' => false,
            'httpMethod' => 'POST',
        );
        //$this->pager = Pager::factory($this->options);
        $this->baseurl = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'));
        //var_dump($this->baseurl.'/multibyte_post.php');
    }
    function tearDown() {
        unset($this->pager);
    }

    function testGetAndPost() {
        $this->pager =& Pager::factory($this->options);
        $this->assertNoPattern('/id=/', $this->pager->links);

        $_GET['id'] = 123;
        $this->pager =& Pager::factory($this->options);
        $this->assertPattern('/id=123/', $this->pager->links);
    }
}
?>