aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HttpUtils/PageUrlTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-13 12:07:13 +0200
committerArthurHoaro <arthur@hoa.ro>2020-10-13 12:07:13 +0200
commitd9f6275ebca035fec8331652c677981056793ccc (patch)
tree37a64baf4f0eba6b781040605965383d8aded2cc /tests/HttpUtils/PageUrlTest.php
parent38672ba0d1c722e5d6d33a58255ceb55e9410e46 (diff)
parentd63ff87a009313141ae684ec447b902562ff6ee7 (diff)
downloadShaarli-d9f6275ebca035fec8331652c677981056793ccc.tar.gz
Shaarli-d9f6275ebca035fec8331652c677981056793ccc.tar.zst
Shaarli-d9f6275ebca035fec8331652c677981056793ccc.zip
Merge branch 'v0.11' into stablestable
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}