diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php index d46120042c..0f4717eaee 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); + $publicUploadEnabled = 'yes'; + $publicUpload = true; $params = [ 'appName' => $this->appName, - 'uploadUrl' => $url + 'uploadUrl' => $url, + 'publicUploadEnabled' => $publicUpload ]; + $this->mockGetPublicUploadAppValue($publicUploadEnabled); + $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($publicUploadEnabled) { + $this->appConfig->expects($this->once()) + ->method('getAppValue') + ->with( + 'core', + 'shareapi_allow_public_upload', + 'yes' + ) + ->willReturn($publicUploadEnabled); + } + /** * Needs to be called at least once by testDownloadWithWrongId() or the tests will fail *