]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added tests.
authorMitar <mitar.git@tnode.com>
Fri, 27 Nov 2015 10:45:49 +0000 (02:45 -0800)
committerMitar <mitar.git@tnode.com>
Fri, 27 Nov 2015 10:45:49 +0000 (02:45 -0800)
tests/lib/appframework/http/RequestTest.php

index ab5fe15444130b2e602c2465e38ff9cd8efb92a0..92a2cc01dd2d5f543cac574f0aea772254a96443 100644 (file)
@@ -648,6 +648,26 @@ class RequestTest extends \Test\TestCase {
                $this->assertSame('http', $request->getServerProtocol());
        }
 
+       public function testGetServerProtocolWithHttpsServerValueEmpty() {
+               $this->config
+                       ->expects($this->once())
+                       ->method('getSystemValue')
+                       ->with('overwriteprotocol')
+                       ->will($this->returnValue(''));
+
+               $request = new Request(
+                       [
+                               'server' => [
+                                       'HTTPS' => ''
+                               ],
+                       ],
+                       $this->secureRandom,
+                       $this->config,
+                       $this->stream
+               );
+               $this->assertSame('http', $request->getServerProtocol());
+       }
+
        public function testGetServerProtocolDefault() {
                $this->config
                        ->expects($this->once())