aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HttpUtils/PageUrlTest.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-12-03 00:34:53 +0100
committerVirtualTam <virtualtam@flibidi.net>2019-01-12 22:47:48 +0100
commit51753e403fa69c0ce124ede27d300477e3e799ca (patch)
tree0afe2a84598648b49cc53bb3e8640569ac370240 /tests/HttpUtils/PageUrlTest.php
parentfb1b182fbf0ee5afed586f77eec84d7a906831ef (diff)
downloadShaarli-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/PageUrlTest.php')
-rw-r--r--tests/HttpUtils/PageUrlTest.php76
1 files changed, 0 insertions, 76 deletions
diff --git a/tests/HttpUtils/PageUrlTest.php b/tests/HttpUtils/PageUrlTest.php
deleted file mode 100644
index 4dbbe9cf..00000000
--- a/tests/HttpUtils/PageUrlTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
1<?php
2/**
3 * HttpUtils' tests
4 */
5
6require_once 'application/HttpUtils.php';
7
8/**
9 * Unitary tests for page_url()
10 */
11class PageUrlTest 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/?p1=v1&p2=v2',
20 page_url(
21 array(
22 'HTTPS' => 'Off',
23 'SERVER_NAME' => 'host.tld',
24 'SERVER_PORT' => '80',
25 'SCRIPT_NAME' => '/index.php',
26 'QUERY_STRING' => 'p1=v1&p2=v2'
27 )
28 )
29 );
30
31 $this->assertEquals(
32 'http://host.tld/admin/?action=edit_tag',
33 page_url(
34 array(
35 'HTTPS' => 'Off',
36 'SERVER_NAME' => 'host.tld',
37 'SERVER_PORT' => '80',
38 'SCRIPT_NAME' => '/admin/index.php',
39 'QUERY_STRING' => 'action=edit_tag'
40 )
41 )
42 );
43 }
44
45 /**
46 * The resource is != "index.php"
47 */
48 public function testOtherResource()
49 {
50 $this->assertEquals(
51 'http://host.tld/page.php?p1=v1&p2=v2',
52 page_url(
53 array(
54 'HTTPS' => 'Off',
55 'SERVER_NAME' => 'host.tld',
56 'SERVER_PORT' => '80',
57 'SCRIPT_NAME' => '/page.php',
58 'QUERY_STRING' => 'p1=v1&p2=v2'
59 )
60 )
61 );
62
63 $this->assertEquals(
64 'http://host.tld/admin/page.php?action=edit_tag',
65 page_url(
66 array(
67 'HTTPS' => 'Off',
68 'SERVER_NAME' => 'host.tld',
69 'SERVER_PORT' => '80',
70 'SCRIPT_NAME' => '/admin/page.php',
71 'QUERY_STRING' => 'action=edit_tag'
72 )
73 )
74 );
75 }
76}