Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJalpreet Singh Nanda (imjalpreet) <jalpreetnanda@gmail.com>2016-03-17 17:44:16 +0300
committerJalpreet Singh Nanda (imjalpreet) <jalpreetnanda@gmail.com>2016-03-18 00:05:47 +0300
commitba2bc8c8a7d998b7b732d8adca87484594b01b0a (patch)
treec973566cb6563cffa970c6facd5d434587cc0e9e /tests
parent0f7858ed0a22ae0699c7a2fccfc4e118c6a7bf26 (diff)
Issue #565: Tests Updated for Issue #565(PR #587)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/controller/PageControllerTest.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php
index d4612004..4b41681c 100644
--- a/tests/unit/controller/PageControllerTest.php
+++ b/tests/unit/controller/PageControllerTest.php
@@ -71,10 +71,14 @@ class PageControllerTest extends \Test\TestCase {
public function testIndex() {
$url = 'http://owncloud/ajax/upload.php';
$this->mockUrlToUploadEndpoint($url);
+ $publicUploadEnabled = 'yes';
$params = [
'appName' => $this->appName,
- 'uploadUrl' => $url
+ 'uploadUrl' => $url,
+ 'publicUploadEnabled' => $publicUploadEnabled
];
+ $this->mockGetPublicUploadAppValue($publicUploadEnabled);
+
$template = new TemplateResponse($this->appName, 'index', $params);
$response = $this->controller->index();
@@ -231,6 +235,17 @@ class PageControllerTest extends \Test\TestCase {
->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
*