Skip to content
Snippets Groups Projects
Unverified Commit 1cdf4e95 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by Lukas Reschke
Browse files

Set default

parent fb4850ff
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ class SecuritySettingsController extends Controller { ...@@ -61,7 +61,7 @@ class SecuritySettingsController extends Controller {
* @return array * @return array
*/ */
public function trustedDomains($newTrustedDomain) { public function trustedDomains($newTrustedDomain) {
$trustedDomains = $this->config->getSystemValue('trusted_domains'); $trustedDomains = $this->config->getSystemValue('trusted_domains', []);
$trustedDomains[] = $newTrustedDomain; $trustedDomains[] = $newTrustedDomain;
$this->config->setSystemValue('trusted_domains', $trustedDomains); $this->config->setSystemValue('trusted_domains', $trustedDomains);
......
...@@ -57,8 +57,8 @@ class SecuritySettingsControllerTest extends \PHPUnit_Framework_TestCase { ...@@ -57,8 +57,8 @@ class SecuritySettingsControllerTest extends \PHPUnit_Framework_TestCase {
$this->container['Config'] $this->container['Config']
->expects($this->once()) ->expects($this->once())
->method('getSystemValue') ->method('getSystemValue')
->with('trusted_domains') ->with($this->equalTo('trusted_domains'), $this->equalTo([]))
->will($this->returnValue('')); ->willReturn([]);
$response = $this->securitySettingsController->trustedDomains('newdomain.com'); $response = $this->securitySettingsController->trustedDomains('newdomain.com');
$expectedResponse = array('status' => 'success'); $expectedResponse = array('status' => 'success');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment