Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(unit): fix RequestTest
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz authored and backportbot[bot] committed Jan 29, 2024
commit 6490e50bb9ce4e3e5525b2fc1fbf30b4893d90d0
7 changes: 4 additions & 3 deletions tests/lib/AppFramework/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1765,14 +1765,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 @@ -1781,13 +1781,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