Skip to content
Closed
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]>

[skip ci]
  • Loading branch information
blizzz authored and backportbot[bot] committed Jan 29, 2024
commit e3453792cd21c4b72627c307c53cbef65ffcdec3
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('getSystemValue')
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