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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-08-04 19:33:19 +0300
committerBjoern Schiessle <schiessle@owncloud.com>2015-08-04 19:33:19 +0300
commitdc5e89e624ca7bcc5ff4f9ce5068ccbc75cda7f6 (patch)
treead7dc793c875af12fb232bb0ef9e291e9de12ea3 /tests
parent573177d1768dd69dde94106919a61344f4146794 (diff)
also block certificate management in the back-end if external storages are disabled for the user
Diffstat (limited to 'tests')
-rw-r--r--tests/settings/controller/CertificateControllerTest.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/settings/controller/CertificateControllerTest.php b/tests/settings/controller/CertificateControllerTest.php
index b6981195034..023d7753cca 100644
--- a/tests/settings/controller/CertificateControllerTest.php
+++ b/tests/settings/controller/CertificateControllerTest.php
@@ -21,6 +21,7 @@
namespace OC\Settings\Controller;
+use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
@@ -41,6 +42,8 @@ class CertificateControllerTest extends \Test\TestCase {
private $certificateManager;
/** @var IL10N */
private $l10n;
+ /** @var IAppManager */
+ private $appManager;
public function setUp() {
parent::setUp();
@@ -48,13 +51,21 @@ class CertificateControllerTest extends \Test\TestCase {
$this->request = $this->getMock('\OCP\IRequest');
$this->certificateManager = $this->getMock('\OCP\ICertificateManager');
$this->l10n = $this->getMock('\OCP\IL10N');
-
- $this->certificateController = new CertificateController(
- 'settings',
- $this->request,
- $this->certificateManager,
- $this->l10n
- );
+ $this->appManager = $this->getMock('OCP\App\IAppManager');
+
+ $this->certificateController = $this->getMockBuilder('OC\Settings\Controller\CertificateController')
+ ->setConstructorArgs(
+ [
+ 'settings',
+ $this->request,
+ $this->certificateManager,
+ $this->l10n,
+ $this->appManager
+ ]
+ )->setMethods(['isCertificateImportAllowed'])->getMock();
+
+ $this->certificateController->expects($this->any())
+ ->method('isCertificateImportAllowed')->willReturn(true);
}
public function testAddPersonalRootCertificateWithEmptyFile() {