]> source.dussan.org Git - nextcloud-server.git/commitdiff
Set default
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 6 Sep 2016 08:29:14 +0000 (10:29 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Wed, 7 Sep 2016 20:09:32 +0000 (22:09 +0200)
settings/Controller/SecuritySettingsController.php
tests/Settings/Controller/SecuritySettingsControllerTest.php

index 44e07f25a0b2d9ea57469a4b3c242bc2519a5d92..d0d5743779982598d1e7e70f83250d91ad94c8d2 100644 (file)
@@ -61,7 +61,7 @@ class SecuritySettingsController extends Controller {
         * @return array
         */
        public function trustedDomains($newTrustedDomain) {
-               $trustedDomains = $this->config->getSystemValue('trusted_domains');
+               $trustedDomains = $this->config->getSystemValue('trusted_domains', []);
                $trustedDomains[] = $newTrustedDomain;
                $this->config->setSystemValue('trusted_domains', $trustedDomains);
 
index 11b0edcae237de80c8aa5ff6f221d33e58abe071..302dc730fc435e49243eb2d795422f4a0437150f 100644 (file)
@@ -57,8 +57,8 @@ class SecuritySettingsControllerTest extends \PHPUnit_Framework_TestCase {
                $this->container['Config']
                        ->expects($this->once())
                        ->method('getSystemValue')
-                       ->with('trusted_domains')
-                       ->will($this->returnValue(''));
+                       ->with($this->equalTo('trusted_domains'), $this->equalTo([]))
+                       ->willReturn([]);
 
                $response = $this->securitySettingsController->trustedDomains('newdomain.com');
                $expectedResponse = array('status' => 'success');