6 require_once 'application/HttpUtils.php';
9 * Unitary tests for index_url()
11 class IndexUrlTest
extends PHPUnit_Framework_TestCase
14 * If on the main page, remove "index.php" from the URL resource
16 public function testRemoveIndex()
23 'SERVER_NAME' => 'host.tld',
24 'SERVER_PORT' => '80',
25 'SCRIPT_NAME' => '/index.php'
31 'http://host.tld/admin/',
35 'SERVER_NAME' => 'host.tld',
36 'SERVER_PORT' => '80',
37 'SCRIPT_NAME' => '/admin/index.php'
44 * The resource is != "index.php"
46 public function testOtherResource()
49 'http://host.tld/page.php',
53 'SERVER_NAME' => 'host.tld',
54 'SERVER_PORT' => '80',
55 'SCRIPT_NAME' => '/page.php'
61 'http://host.tld/admin/page.php',
65 'SERVER_NAME' => 'host.tld',
66 'SERVER_PORT' => '80',
67 'SCRIPT_NAME' => '/admin/page.php'