From: Roeland Jago Douma Date: Tue, 6 Sep 2016 08:29:14 +0000 (+0200) Subject: Set default X-Git-Tag: v11.0RC2~650^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1cdf4e9540b6b804fafec045371a64bd0bcfa027;p=nextcloud-server.git Set default --- diff --git a/settings/Controller/SecuritySettingsController.php b/settings/Controller/SecuritySettingsController.php index 44e07f25a0b..d0d57437799 100644 --- a/settings/Controller/SecuritySettingsController.php +++ b/settings/Controller/SecuritySettingsController.php @@ -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); diff --git a/tests/Settings/Controller/SecuritySettingsControllerTest.php b/tests/Settings/Controller/SecuritySettingsControllerTest.php index 11b0edcae23..302dc730fc4 100644 --- a/tests/Settings/Controller/SecuritySettingsControllerTest.php +++ b/tests/Settings/Controller/SecuritySettingsControllerTest.php @@ -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');