[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] cvs: pear /Pager/tests pager_test.php
From:       "Lorenzo Alberton" <quipo () php ! net>
Date:       2008-05-31 12:45:25
Message-ID: cvsquipo1212237925 () cvsserver
[Download RAW message or body]

quipo		Sat May 31 12:45:25 2008 UTC

  Modified files:              
    /pear/Pager/tests	pager_test.php 
  Log:
  test for bug #13881: fix for relative links (introduced in v.2.4.5) may cause some \
issues with absolute links  
http://cvs.php.net/viewvc.cgi/pear/Pager/tests/pager_test.php?r1=1.34&r2=1.35&diff_format=u
                
Index: pear/Pager/tests/pager_test.php
diff -u pear/Pager/tests/pager_test.php:1.34 pear/Pager/tests/pager_test.php:1.35
--- pear/Pager/tests/pager_test.php:1.34	Sun May 18 18:06:38 2008
+++ pear/Pager/tests/pager_test.php	Sat May 31 12:45:25 2008
@@ -1,5 +1,5 @@
 <?php
-// $Id: pager_test.php,v 1.34 2008/05/18 18:06:38 quipo Exp $
+// $Id: pager_test.php,v 1.35 2008/05/31 12:45:25 quipo Exp $
 
 require_once 'simple_include.php';
 require_once 'pager_include.php';
@@ -21,28 +21,28 @@
     function tearDown() {
         unset($this->pager);
     }
-    function testCurrentPageID () {
+    function testCurrentPageID() {
         $this->assertEqual(1, $this->pager->getCurrentPageID());
     }
-    function testNextPageID () {
+    function testNextPageID() {
         $this->assertEqual(2, $this->pager->getNextPageID());
     }
-    function testPrevPageID () {
+    function testPrevPageID() {
         $this->assertEqual(false, $this->pager->getPreviousPageID());
     }
-    function testNumItems () {
+    function testNumItems() {
         $this->assertEqual(10, $this->pager->numItems());
     }
-    function testNumPages () {
+    function testNumPages() {
         $this->assertEqual(2, $this->pager->numPages());
     }
-    function testFirstPage () {
+    function testFirstPage() {
         $this->assertEqual(true, $this->pager->isFirstPage());
     }
-    function testLastPage () {
+    function testLastPage() {
         $this->assertEqual(false, $this->pager->isLastPage());
     }
-    function testLastPageComplete () {
+    function testLastPageComplete() {
         $this->assertEqual(true, $this->pager->isLastPageComplete());
     }
     function testOffsetByPageId() {
@@ -721,6 +721,34 @@
         $expected = '<a href="' . $_SERVER['PHP_SELF'] . '?pageID=2" title="next \
page">&raquo;</a>';  $this->assertEqual($expected, $this->pager->_getNextLink());
     }
+    //http://pear.php.net/bugs/bug.php?id=12306
+    function testAbsoluteLinks() {
+        // Reproduces bug #13881
+        $options = array (
+            'mode' => 'Sliding',
+            'delta' => 5,
+            'totalItems' => 50,
+            'perPage' => 10,
+            'urlVar' => 'page',
+            'currentPage' => 1,
+            'append' => false,
+            'path' => '',
+            'fileName' => '/report/alpha/page/%d/orderBy/foo/direction/asc',
+            'spacesBeforeSeparator' => 0,
+            'spacesAfterSeparator'  => 0,
+        );
+        $this->pager = Pager::factory($options);
+        $this->pager->build();
+        $expected = '<a href="/report/alpha/page/2/orderBy/foo/direction/asc" \
title="next page">&raquo;</a>'; +        $this->assertEqual($expected, \
$this->pager->_getNextLink()); +
+        $options['path'] = '/';
+        $options['fileName'] = '/report/alpha/page/%d/orderBy/foo/direction/asc';
+        $this->pager = Pager::factory($options);
+        $this->pager->build();
+        $expected = '<a href="/report/alpha/page/2/orderBy/foo/direction/asc" \
title="next page">&raquo;</a>'; +        $this->assertEqual($expected, \
$this->pager->_getNextLink()); +    }
     //http://pear.php.net/bugs/bug.php?id=13913
     function testEmptyPagerWithImgEmpty() {
         $options = array(



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic