6 namespace Shaarli\Http
;
8 require_once 'application/http/HttpUtils.php';
11 * Unitary tests for index_url()
13 class IndexUrlTest
extends \PHPUnit\Framework\TestCase
16 * If on the main page, remove "index.php" from the URL resource
18 public function testRemoveIndex()
25 'SERVER_NAME' => 'host.tld',
26 'SERVER_PORT' => '80',
27 'SCRIPT_NAME' => '/index.php'
33 'http://host.tld/admin/',
37 'SERVER_NAME' => 'host.tld',
38 'SERVER_PORT' => '80',
39 'SCRIPT_NAME' => '/admin/index.php'
46 * The resource is != "index.php"
48 public function testOtherResource()
51 'http://host.tld/page.php',
55 'SERVER_NAME' => 'host.tld',
56 'SERVER_PORT' => '80',
57 'SCRIPT_NAME' => '/page.php'
63 'http://host.tld/admin/page.php',
67 'SERVER_NAME' => 'host.tld',
68 'SERVER_PORT' => '80',
69 'SCRIPT_NAME' => '/admin/page.php'