]> source.dussan.org Git - nextcloud-server.git/commitdiff
test(unit): fix RequestTest 43182/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 26 Jan 2024 12:11:29 +0000 (13:11 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 29 Jan 2024 09:59:35 +0000 (09:59 +0000)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
tests/lib/AppFramework/Http/RequestTest.php

index e042d9338712a3bd6a89bd9d1092e8f83717e3dd..030f16f15c4ab8068015724e933194e0d1aff060 100644 (file)
@@ -1765,14 +1765,14 @@ class RequestTest extends \Test\TestCase {
        public function providesGetRequestUriWithOverwriteData() {
                return [
                        ['/scriptname.php/some/PathInfo', '/owncloud/', ''],
-                       ['/scriptname.php/some/PathInfo', '/owncloud/', '123'],
+                       ['/scriptname.php/some/PathInfo', '/owncloud/', '123', '123.123.123.123'],
                ];
        }
 
        /**
         * @dataProvider providesGetRequestUriWithOverwriteData
         */
-       public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr) {
+       public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr, $remoteAddr = '') {
                $this->config
                        ->expects($this->exactly(2))
                        ->method('getSystemValueString')
@@ -1781,13 +1781,14 @@ class RequestTest extends \Test\TestCase {
                                ['overwritecondaddr', '', $overwriteCondAddr],
                        ]);
 
-               $request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
+               $request = $this->getMockBuilder(Request::class)
                        ->setMethods(['getScriptName'])
                        ->setConstructorArgs([
                                [
                                        'server' => [
                                                'REQUEST_URI' => '/test.php/some/PathInfo',
                                                'SCRIPT_NAME' => '/test.php',
+                                               'REMOTE_ADDR' => $remoteAddr
                                        ]
                                ],
                                $this->requestId,