6 require_once 'application/HttpUtils.php';
9 * Unitary tests for page_url()
11 class PageUrlTest
extends PHPUnit_Framework_TestCase
14 * If on the main page, remove "index.php" from the URL resource
16 public function testRemoveIndex()
19 'http://host.tld/?p1=v1&p2=v2',
23 'SERVER_NAME' => 'host.tld',
24 'SERVER_PORT' => '80',
25 'SCRIPT_NAME' => '/index.php',
26 'QUERY_STRING' => 'p1=v1&p2=v2'
32 'http://host.tld/admin/?action=edit_tag',
36 'SERVER_NAME' => 'host.tld',
37 'SERVER_PORT' => '80',
38 'SCRIPT_NAME' => '/admin/index.php',
39 'QUERY_STRING' => 'action=edit_tag'
46 * The resource is != "index.php"
48 public function testOtherResource()
51 'http://host.tld/page.php?p1=v1&p2=v2',
55 'SERVER_NAME' => 'host.tld',
56 'SERVER_PORT' => '80',
57 'SCRIPT_NAME' => '/page.php',
58 'QUERY_STRING' => 'p1=v1&p2=v2'
64 'http://host.tld/admin/page.php?action=edit_tag',
68 'SERVER_NAME' => 'host.tld',
69 'SERVER_PORT' => '80',
70 'SCRIPT_NAME' => '/admin/page.php',
71 'QUERY_STRING' => 'action=edit_tag'