Skip to content

Commit

Permalink
test(unit): fix RequestTest
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Jan 27, 2024
1 parent 30ad530 commit 216b95f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/lib/AppFramework/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1822,14 +1822,14 @@ public function testGetRequestUriWithoutOverwrite() {
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')
Expand All @@ -1838,13 +1838,14 @@ public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot,
['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,
Expand Down

0 comments on commit 216b95f

Please sign in to comment.