UTUrl Class Reference
[Unit Tests - Unit tests for all classes/functions in fareofficelib.]

Unit test for all functions in UrlResolve.class.php. More...

List of all members.

Public Member Functions

 doTest ()
 testAbsUrl ()


Detailed Description

Unit test for all functions in UrlResolve.class.php.

Author:
Daniel Lindh <[email protected]>

Definition at line 8 of file UTUrl.class.php.


Member Function Documentation

UTUrl::doTest (  ) 

Definition at line 10 of file UTUrl.class.php.

References testAbsUrl().

00011   {
00012     $this->testAbsUrl();
00013 
00014   }

UTUrl::testAbsUrl (  ) 

Definition at line 16 of file UTUrl.class.php.

Referenced by doTest().

00017   {
00018     $test = array
00019     (
00020         "g:h"           =>  "g:h",
00021         "g"             =>  "http://a/b/c/g",
00022         "./g"           =>  "http://a/b/c/g",
00023         "g/"            =>  "http://a/b/c/g/",
00024         "/g"            =>  "http://a/g",
00025         "?y"            =>  "http://a/b/c/d;p?y",
00026         "g?y"           =>  "http://a/b/c/g?y",
00027         "#s"            =>  "http://a/b/c/d;p?q#s",
00028         "g#s"           =>  "http://a/b/c/g#s",
00029         "g?y#s"         =>  "http://a/b/c/g?y#s",
00030         ";x"            =>  "http://a/b/c/;x",
00031         "g;x"           =>  "http://a/b/c/g;x",
00032         "g;x?y#s"       =>  "http://a/b/c/g;x?y#s",
00033         ""              =>  "http://a/b/c/d;p?q",
00034         "."             =>  "http://a/b/c/",
00035         "./"            =>  "http://a/b/c/",
00036         ".."            =>  "http://a/b/",
00037         "../"           =>  "http://a/b/",
00038         "../g"          =>  "http://a/b/g",
00039         "../.."         =>  "http://a/",
00040         "../../"        =>  "http://a/",
00041         "../../g"       =>  "http://a/g",
00042         "../../../g"    =>  "http://a/g",
00043         "../../../../g" =>  "http://a/g",
00044         "/./g"          =>  "http://a/g",
00045         "/../g"         =>  "http://a/g",
00046         "g."            =>  "http://a/b/c/g.",
00047         ".g"            =>  "http://a/b/c/.g",
00048         "g.."           =>  "http://a/b/c/g..",
00049         "..g"           =>  "http://a/b/c/..g",
00050         "./../g"        =>  "http://a/b/g",
00051         "./g/."         =>  "http://a/b/c/g/",
00052         "g/./h"         =>  "http://a/b/c/g/h",
00053         "g/../h"        =>  "http://a/b/c/h",
00054         "g;x=1/./y"     =>  "http://a/b/c/g;x=1/y",
00055         "g;x=1/../y"    =>  "http://a/b/c/y",
00056         "g?y/./x"       =>  "http://a/b/c/g?y/./x",
00057         "g?y/../x"      =>  "http://a/b/c/g?y/../x",
00058         "g#s/./x"       =>  "http://a/b/c/g#s/./x",
00059         "g#s/../x"      =>  "http://a/b/c/g#s/../x",
00060     );
00061 
00062     $this->setSectionLabel('absurl');
00063 
00064     foreach ($test as $key=>$value)
00065     {
00066       eval($this->needEqual('url::absUrl("http://a/b/c/d;p?q", "' . $key .'")', '$value'));
00067     }
00068 
00069     eval($this->needEqual('url::absUrl("http://cybercow.se/php/ex/absurl/index.php?moo=aa", "../error/index.php")', '"http://cybercow.se/php/ex/error/index.php"'));
00070   }


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:28:24 2009 for fareofficelib by  doxygen 1.5.8