Set default

This commit is contained in:
Roeland Jago Douma 2016-09-06 10:29:14 +02:00 committed by Lukas Reschke
parent fb4850ffa8
commit 1cdf4e9540
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1
2 changed files with 3 additions and 3 deletions

View 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);

View 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');