diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 17:18:46 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 17:18:46 +0200 |
commit | 314fc11e1beb37e683cfa874e74ae3103632d803 (patch) | |
tree | c7b4770940717af8331e9a1d96ca08c003f33197 /tests | |
parent | 6e8e411abf5faa2f53f4b800d085aec756ceb7bf (diff) | |
parent | dc5e89e624ca7bcc5ff4f9ce5068ccbc75cda7f6 (diff) | |
download | nextcloud-server-314fc11e1beb37e683cfa874e74ae3103632d803.tar.gz nextcloud-server-314fc11e1beb37e683cfa874e74ae3103632d803.zip |
Merge pull request #18057 from owncloud/import_root_certificates
disable "ssl root certificate" settings if user can't mount external storages
Diffstat (limited to 'tests')
-rw-r--r-- | tests/settings/controller/CertificateControllerTest.php | 25 |
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() { |