diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php index d46120042c..360558ecb1 100644 --- a/tests/unit/controller/PageControllerTest.php +++ b/tests/unit/controller/PageControllerTest.php @@ -71,10 +71,15 @@ protected function setUp() { public function testIndex() { $url = 'http://owncloud/ajax/upload.php'; $this->mockUrlToUploadEndpoint($url); + $publicUpload = 'yes'; + $publicUploadEnabled = true; $params = [ 'appName' => $this->appName, - 'uploadUrl' => $url + 'uploadUrl' => $url, + 'publicUploadEnabled' => $publicUploadEnabled ]; + $this->mockGetPublicUploadAppValue($publicUpload); + $template = new TemplateResponse($this->appName, 'index', $params); $response = $this->controller->index(); @@ -231,6 +236,17 @@ private function mockUrlToDownloadPage($token, $fileId, $filename, $url) { ->willReturn($url); } + private function mockGetPublicUploadAppValue($publicUpload) { + $this->appConfig->expects($this->once()) + ->method('getAppValue') + ->with( + 'core', + 'shareapi_allow_public_upload', + 'yes' + ) + ->willReturn($publicUpload); + } + /** * Needs to be called at least once by testDownloadWithWrongId() or the tests will fail *