diff options
author | VirtualTam <virtualtam@flibidi.net> | 2018-12-03 00:34:53 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2019-01-12 22:47:48 +0100 |
commit | 51753e403fa69c0ce124ede27d300477e3e799ca (patch) | |
tree | 0afe2a84598648b49cc53bb3e8640569ac370240 /tests/HttpUtils/IndexUrlTest.php | |
parent | fb1b182fbf0ee5afed586f77eec84d7a906831ef (diff) | |
download | Shaarli-51753e403fa69c0ce124ede27d300477e3e799ca.tar.gz Shaarli-51753e403fa69c0ce124ede27d300477e3e799ca.tar.zst Shaarli-51753e403fa69c0ce124ede27d300477e3e799ca.zip |
namespacing: move HTTP utilities along \Shaarli\Http\ classes
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/HttpUtils/IndexUrlTest.php')
-rw-r--r-- | tests/HttpUtils/IndexUrlTest.php | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/tests/HttpUtils/IndexUrlTest.php b/tests/HttpUtils/IndexUrlTest.php deleted file mode 100644 index 337dcab0..00000000 --- a/tests/HttpUtils/IndexUrlTest.php +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * HttpUtils' tests | ||
4 | */ | ||
5 | |||
6 | require_once 'application/HttpUtils.php'; | ||
7 | |||
8 | /** | ||
9 | * Unitary tests for index_url() | ||
10 | */ | ||
11 | class IndexUrlTest extends PHPUnit_Framework_TestCase | ||
12 | { | ||
13 | /** | ||
14 | * If on the main page, remove "index.php" from the URL resource | ||
15 | */ | ||
16 | public function testRemoveIndex() | ||
17 | { | ||
18 | $this->assertEquals( | ||
19 | 'http://host.tld/', | ||
20 | index_url( | ||
21 | array( | ||
22 | 'HTTPS' => 'Off', | ||
23 | 'SERVER_NAME' => 'host.tld', | ||
24 | 'SERVER_PORT' => '80', | ||
25 | 'SCRIPT_NAME' => '/index.php' | ||
26 | ) | ||
27 | ) | ||
28 | ); | ||
29 | |||
30 | $this->assertEquals( | ||
31 | 'http://host.tld/admin/', | ||
32 | index_url( | ||
33 | array( | ||
34 | 'HTTPS' => 'Off', | ||
35 | 'SERVER_NAME' => 'host.tld', | ||
36 | 'SERVER_PORT' => '80', | ||
37 | 'SCRIPT_NAME' => '/admin/index.php' | ||
38 | ) | ||
39 | ) | ||
40 | ); | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * The resource is != "index.php" | ||
45 | */ | ||
46 | public function testOtherResource() | ||
47 | { | ||
48 | $this->assertEquals( | ||
49 | 'http://host.tld/page.php', | ||
50 | page_url( | ||
51 | array( | ||
52 | 'HTTPS' => 'Off', | ||
53 | 'SERVER_NAME' => 'host.tld', | ||
54 | 'SERVER_PORT' => '80', | ||
55 | 'SCRIPT_NAME' => '/page.php' | ||
56 | ) | ||
57 | ) | ||
58 | ); | ||
59 | |||
60 | $this->assertEquals( | ||
61 | 'http://host.tld/admin/page.php', | ||
62 | page_url( | ||
63 | array( | ||
64 | 'HTTPS' => 'Off', | ||
65 | 'SERVER_NAME' => 'host.tld', | ||
66 | 'SERVER_PORT' => '80', | ||
67 | 'SCRIPT_NAME' => '/admin/page.php' | ||
68 | ) | ||
69 | ) | ||
70 | ); | ||
71 | } | ||
72 | } | ||