summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-04-17 17:47:11 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-04-17 17:47:11 +0200
commit0d5142be7080fba001d74609676e7e1ddd5b547f (patch)
tree662375f501297ed2abace99465f1c67a178459b4 /tests
parent42b7dfe9ac84da2e3e2bda732b0e94c68df9d515 (diff)
downloadnextcloud-server-0d5142be7080fba001d74609676e7e1ddd5b547f.tar.gz
nextcloud-server-0d5142be7080fba001d74609676e7e1ddd5b547f.zip
Show a link to the docs instead of a button on the untrusted domain page
Before there was a button to "quickly" add the untrusted domain to the config. This button often didn't worked, because the generated URL was often untrusted as well. Thus removing it and providing proper docs seems to be the better approach to handle this rare case. Also the log should not be spammed by messages for the untrusted domain accesses, because they are user related and not necessarily an administrative issue. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/ApplicationTest.php2
-rw-r--r--tests/Settings/Controller/SecuritySettingsControllerTest.php72
2 files changed, 0 insertions, 74 deletions
diff --git a/tests/Settings/ApplicationTest.php b/tests/Settings/ApplicationTest.php
index 8346f668d9d..31391a8fac6 100644
--- a/tests/Settings/ApplicationTest.php
+++ b/tests/Settings/ApplicationTest.php
@@ -33,7 +33,6 @@ use OC\Settings\Controller\CheckSetupController;
use OC\Settings\Controller\GroupsController;
use OC\Settings\Controller\LogSettingsController;
use OC\Settings\Controller\MailSettingsController;
-use OC\Settings\Controller\SecuritySettingsController;
use OC\Settings\Controller\UsersController;
use OC\Settings\Middleware\SubadminMiddleware;
use OCP\AppFramework\Controller;
@@ -76,7 +75,6 @@ class ApplicationTest extends TestCase {
[GroupsController::class, Controller::class],
[LogSettingsController::class, Controller::class],
[MailSettingsController::class, Controller::class],
- [SecuritySettingsController::class, Controller::class],
[UsersController::class, Controller::class],
[SubadminMiddleware::class, Middleware::class],
diff --git a/tests/Settings/Controller/SecuritySettingsControllerTest.php b/tests/Settings/Controller/SecuritySettingsControllerTest.php
deleted file mode 100644
index 75d580d9f85..00000000000
--- a/tests/Settings/Controller/SecuritySettingsControllerTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * @author Lukas Reschke
- * @copyright 2014 Lukas Reschke lukas@owncloud.com
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-namespace Tests\Settings\Controller;
-
-use \OC\Settings\Application;
-use OC\Settings\Controller\SecuritySettingsController;
-use OCP\IConfig;
-use OCP\IRequest;
-
-/**
- * @package Tests\Settings\Controller
- */
-class SecuritySettingsControllerTest extends \Test\TestCase {
-
- /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
- private $config;
-
- /** @var SecuritySettingsController */
- private $securitySettingsController;
-
- protected function setUp() {
- parent::setUp();
-
- $this->config = $this->createMock(IConfig::class);
- $this->securitySettingsController = new SecuritySettingsController(
- 'settings',
- $this->createMock(IRequest::class),
- $this->config
- );
- }
-
- public function testTrustedDomainsWithExistingValues() {
- $this->config
- ->expects($this->once())
- ->method('setSystemValue')
- ->with('trusted_domains', array('owncloud.org', 'owncloud.com', 'newdomain.com'));
- $this->config
- ->expects($this->once())
- ->method('getSystemValue')
- ->with('trusted_domains')
- ->will($this->returnValue(array('owncloud.org', 'owncloud.com')));
-
- $response = $this->securitySettingsController->trustedDomains('newdomain.com');
- $expectedResponse = array('status' => 'success');
-
- $this->assertSame($expectedResponse, $response);
- }
-
- public function testTrustedDomainsEmpty() {
- $this->config
- ->expects($this->once())
- ->method('setSystemValue')
- ->with('trusted_domains', array('newdomain.com'));
- $this->config
- ->expects($this->once())
- ->method('getSystemValue')
- ->with($this->equalTo('trusted_domains'), $this->equalTo([]))
- ->willReturn([]);
-
- $response = $this->securitySettingsController->trustedDomains('newdomain.com');
- $expectedResponse = array('status' => 'success');
-
- $this->assertSame($expectedResponse, $response);
- }
-}