diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /tests/lib/ConfigTest.php | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/ConfigTest.php')
-rw-r--r-- | tests/lib/ConfigTest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php index 109f7471e96..58144b2c26a 100644 --- a/tests/lib/ConfigTest.php +++ b/tests/lib/ConfigTest.php @@ -12,7 +12,7 @@ class ConfigTest extends TestCase { const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar", "beers" => array("Appenzeller", "Guinness", "Kölsch"), "alcohol_free" => false);'; /** @var array */ - private $initialConfig = array('foo' => 'bar', 'beers' => array('Appenzeller', 'Guinness', 'Kölsch'), 'alcohol_free' => false); + private $initialConfig = ['foo' => 'bar', 'beers' => ['Appenzeller', 'Guinness', 'Kölsch'], 'alcohol_free' => false]; /** @var string */ private $configFile; /** @var \OC\Config */ @@ -35,7 +35,7 @@ class ConfigTest extends TestCase { } public function testGetKeys() { - $expectedConfig = array('foo', 'beers', 'alcohol_free'); + $expectedConfig = ['foo', 'beers', 'alcohol_free']; $this->assertSame($expectedConfig, $this->config->getKeys()); } @@ -44,8 +44,8 @@ class ConfigTest extends TestCase { $this->assertSame(null, $this->config->getValue('bar')); $this->assertSame('moo', $this->config->getValue('bar', 'moo')); $this->assertSame(false, $this->config->getValue('alcohol_free', 'someBogusValue')); - $this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers', 'someBogusValue')); - $this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers')); + $this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $this->config->getValue('beers', 'someBogusValue')); + $this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $this->config->getValue('beers')); } public function testGetValueReturnsEnvironmentValueIfSet() { @@ -81,9 +81,9 @@ class ConfigTest extends TestCase { $this->assertEquals($expected, $content); $this->config->setValue('bar', 'red'); - $this->config->setValue('apps', array('files', 'gallery')); + $this->config->setValue('apps', ['files', 'gallery']); $expectedConfig['bar'] = 'red'; - $expectedConfig['apps'] = array('files', 'gallery'); + $expectedConfig['apps'] = ['files', 'gallery']; $this->assertAttributeEquals($expectedConfig, 'cache', $this->config); $content = file_get_contents($this->configFile); @@ -150,7 +150,7 @@ class ConfigTest extends TestCase { $this->assertEquals(self::TESTCONTENT, file_get_contents($this->configFile)); // Write a new value to the config - $this->config->setValue('CoolWebsites', array('demo.owncloud.org', 'owncloud.org', 'owncloud.com')); + $this->config->setValue('CoolWebsites', ['demo.owncloud.org', 'owncloud.org', 'owncloud.com']); $expected = "<?php\n\$CONFIG = array (\n 'foo' => 'bar',\n 'beers' => \n array (\n 0 => 'Appenzeller',\n " . " 1 => 'Guinness',\n 2 => 'Kölsch',\n ),\n 'alcohol_free' => false,\n 'php53' => 'totallyOutdated',\n 'CoolWebsites' => \n array (\n " . " 0 => 'demo.owncloud.org',\n 1 => 'owncloud.org',\n 2 => 'owncloud.com',\n ),\n);\n"; |