aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/HttpUtils/ServerUrlTest.php28
-rw-r--r--tests/LinkFilterTest.php3
2 files changed, 29 insertions, 2 deletions
diff --git a/tests/HttpUtils/ServerUrlTest.php b/tests/HttpUtils/ServerUrlTest.php
index 7fdad659..dac02b3e 100644
--- a/tests/HttpUtils/ServerUrlTest.php
+++ b/tests/HttpUtils/ServerUrlTest.php
@@ -39,6 +39,34 @@ class ServerUrlTest extends PHPUnit_Framework_TestCase
39 } 39 }
40 40
41 /** 41 /**
42 * Detect a Proxy that sets Forwarded-Host
43 */
44 public function testHttpsProxyForwardedHost()
45 {
46 $this->assertEquals(
47 'https://host.tld:8080',
48 server_url(
49 array(
50 'HTTP_X_FORWARDED_PROTO' => 'https',
51 'HTTP_X_FORWARDED_PORT' => '8080',
52 'HTTP_X_FORWARDED_HOST' => 'host.tld'
53 )
54 )
55 );
56
57 $this->assertEquals(
58 'https://host.tld:4974',
59 server_url(
60 array(
61 'HTTP_X_FORWARDED_PROTO' => 'https, https',
62 'HTTP_X_FORWARDED_PORT' => '4974, 80',
63 'HTTP_X_FORWARDED_HOST' => 'host.tld, example.com'
64 )
65 )
66 );
67 }
68
69 /**
42 * Detect a Proxy with SSL enabled 70 * Detect a Proxy with SSL enabled
43 */ 71 */
44 public function testHttpsProxyForward() 72 public function testHttpsProxyForward()
diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php
index 74162358..d796d3a3 100644
--- a/tests/LinkFilterTest.php
+++ b/tests/LinkFilterTest.php
@@ -63,10 +63,9 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
63 count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, '')) 63 count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, ''))
64 ); 64 );
65 65
66 // Untagged only
67 $this->assertEquals( 66 $this->assertEquals(
68 self::$refDB->countUntaggedLinks(), 67 self::$refDB->countUntaggedLinks(),
69 count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, false)) 68 count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, /*$request=*/'', /*$casesensitive=*/false, /*$visibility=*/'all', /*$untaggedonly=*/true))
70 ); 69 );
71 70
72 $this->assertEquals( 71 $this->assertEquals(