aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/ConfigTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-23 21:38:22 +0200
committerGitHub <noreply@github.com>2020-07-23 21:38:22 +0200
commita169bd243ff4b014fa4238845dbebbbc2a4d1021 (patch)
treea1fee830c286b0911aae9f4c141572a92261080d /tests/lib/ConfigTest.php
parent173f8abc7ed48d2436d8df10ad66bc4907d4bb52 (diff)
parent761cdf9877be6d286f96e1f3eb4beab052b89baa (diff)
downloadnextcloud-server-a169bd243ff4b014fa4238845dbebbbc2a4d1021.tar.gz
nextcloud-server-a169bd243ff4b014fa4238845dbebbbc2a4d1021.zip
Merge pull request #21972 from nextcloud/techdebt/noid/cleanup-phpunit-warnings
Fix PHPUnit deprecation warnings
Diffstat (limited to 'tests/lib/ConfigTest.php')
-rw-r--r--tests/lib/ConfigTest.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php
index aa6c50528cc..d360d115824 100644
--- a/tests/lib/ConfigTest.php
+++ b/tests/lib/ConfigTest.php
@@ -71,9 +71,7 @@ class ConfigTest extends TestCase {
public function testSetValue() {
$this->config->setValue('foo', 'moo');
- $expectedConfig = $this->initialConfig;
- $expectedConfig['foo'] = 'moo';
- $this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
+ $this->assertSame('moo', $this->config->getValue('foo'));
$content = file_get_contents($this->configFile);
$expected = "<?php\n\$CONFIG = array (\n 'foo' => 'moo',\n 'beers' => \n array (\n 0 => 'Appenzeller',\n " .
@@ -82,9 +80,8 @@ class ConfigTest extends TestCase {
$this->config->setValue('bar', 'red');
$this->config->setValue('apps', ['files', 'gallery']);
- $expectedConfig['bar'] = 'red';
- $expectedConfig['apps'] = ['files', 'gallery'];
- $this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
+ $this->assertSame('red', $this->config->getValue('bar'));
+ $this->assertSame(['files', 'gallery'], $this->config->getValue('apps'));
$content = file_get_contents($this->configFile);
@@ -105,7 +102,8 @@ class ConfigTest extends TestCase {
'not_exists' => null,
]);
- $this->assertAttributeEquals($this->initialConfig, 'cache', $this->config);
+ $this->assertSame('bar', $this->config->getValue('foo'));
+ $this->assertSame(null, $this->config->getValue('not_exists'));
$content = file_get_contents($this->configFile);
$this->assertEquals(self::TESTCONTENT, $content);
@@ -113,10 +111,8 @@ class ConfigTest extends TestCase {
'foo' => 'moo',
'alcohol_free' => null,
]);
- $expectedConfig = $this->initialConfig;
- $expectedConfig['foo'] = 'moo';
- unset($expectedConfig['alcohol_free']);
- $this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
+ $this->assertSame('moo', $this->config->getValue('foo'));
+ $this->assertSame(null, $this->config->getValue('not_exists'));
$content = file_get_contents($this->configFile);
$expected = "<?php\n\$CONFIG = array (\n 'foo' => 'moo',\n 'beers' => \n array (\n 0 => 'Appenzeller',\n " .
@@ -126,9 +122,7 @@ class ConfigTest extends TestCase {
public function testDeleteKey() {
$this->config->deleteKey('foo');
- $expectedConfig = $this->initialConfig;
- unset($expectedConfig['foo']);
- $this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
+ $this->assertSame('this_was_clearly_not_set_before', $this->config->getValue('foo', 'this_was_clearly_not_set_before'));
$content = file_get_contents($this->configFile);
$expected = "<?php\n\$CONFIG = array (\n 'beers' => \n array (\n 0 => 'Appenzeller',\n " .