diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-07-16 16:40:57 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-07-16 16:40:57 +0200 |
commit | bd71540c8a8fe0ef2f66ef491edff5cd7a1c73ef (patch) | |
tree | c967dfb8ccee6a724abfdbea6f019de42674aa0c /tests/lib | |
parent | 15877ac7eba002df64493b036191759e939b16e9 (diff) | |
download | nextcloud-server-bd71540c8a8fe0ef2f66ef491edff5cd7a1c73ef.tar.gz nextcloud-server-bd71540c8a8fe0ef2f66ef491edff5cd7a1c73ef.zip |
Fixing 'Undefined index: REMOTE_ADDR' - fixes #17460
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/appframework/http/RequestTest.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php index de3430d757c..6e86f3d7041 100644 --- a/tests/lib/appframework/http/RequestTest.php +++ b/tests/lib/appframework/http/RequestTest.php @@ -1112,17 +1112,27 @@ class RequestTest extends \Test\TestCase { $this->assertSame('/test.php', $request->getRequestUri()); } - public function testGetRequestUriWithOverwrite() { + public function providesGetRequestUriWithOverwriteData() { + return [ + ['/scriptname.php/some/PathInfo', '/owncloud/', ''], + ['/scriptname.php/some/PathInfo', '/owncloud/', '123'], + ]; + } + + /** + * @dataProvider providesGetRequestUriWithOverwriteData + */ + public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr) { $this->config ->expects($this->at(0)) ->method('getSystemValue') ->with('overwritewebroot') - ->will($this->returnValue('/owncloud/')); + ->will($this->returnValue($overwriteWebRoot)); $this->config ->expects($this->at(1)) ->method('getSystemValue') ->with('overwritecondaddr') - ->will($this->returnValue('')); + ->will($this->returnValue($overwriteCondAddr)); $request = $this->getMockBuilder('\OC\AppFramework\Http\Request') ->setMethods(['getScriptName']) @@ -1143,6 +1153,7 @@ class RequestTest extends \Test\TestCase { ->method('getScriptName') ->will($this->returnValue('/scriptname.php')); - $this->assertSame('/scriptname.php/some/PathInfo', $request->getRequestUri()); + $this->assertSame($expectedUri, $request->getRequestUri()); } + } |