Skip to content

Commit ac12178

Browse files
committed
test(unit): fix RequestTest
Signed-off-by: Arthur Schiwon <[email protected]>
1 parent ceb4ef7 commit ac12178

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/lib/AppFramework/Http/RequestTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,14 +1822,14 @@ public function testGetRequestUriWithoutOverwrite() {
18221822
public function providesGetRequestUriWithOverwriteData() {
18231823
return [
18241824
['/scriptname.php/some/PathInfo', '/owncloud/', ''],
1825-
['/scriptname.php/some/PathInfo', '/owncloud/', '123'],
1825+
['/scriptname.php/some/PathInfo', '/owncloud/', '123', '123.123.123.123'],
18261826
];
18271827
}
18281828

18291829
/**
18301830
* @dataProvider providesGetRequestUriWithOverwriteData
18311831
*/
1832-
public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr) {
1832+
public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr, $remoteAddr = '') {
18331833
$this->config
18341834
->expects($this->exactly(2))
18351835
->method('getSystemValueString')
@@ -1838,13 +1838,14 @@ public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot,
18381838
['overwritecondaddr', '', $overwriteCondAddr],
18391839
]);
18401840

1841-
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
1841+
$request = $this->getMockBuilder(Request::class)
18421842
->setMethods(['getScriptName'])
18431843
->setConstructorArgs([
18441844
[
18451845
'server' => [
18461846
'REQUEST_URI' => '/test.php/some/PathInfo',
18471847
'SCRIPT_NAME' => '/test.php',
1848+
'REMOTE_ADDR' => $remoteAddr
18481849
]
18491850
],
18501851
$this->requestId,

0 commit comments

Comments
 (0)