aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Services/AppConfigTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Services/AppConfigTest.php')
-rw-r--r--tests/lib/AppFramework/Services/AppConfigTest.php73
1 files changed, 33 insertions, 40 deletions
diff --git a/tests/lib/AppFramework/Services/AppConfigTest.php b/tests/lib/AppFramework/Services/AppConfigTest.php
index 46f73a8c088..38fa6bdcac6 100644
--- a/tests/lib/AppFramework/Services/AppConfigTest.php
+++ b/tests/lib/AppFramework/Services/AppConfigTest.php
@@ -28,7 +28,7 @@ class AppConfigTest extends TestCase {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->appConfigCore = $this->createMock(AppConfigCore::class);
-
+
$this->appConfig = new AppConfig($this->config, $this->appConfigCore, self::TEST_APPID);
}
@@ -46,7 +46,7 @@ class AppConfigTest extends TestCase {
* @return array
* @see testHasAppKey
*/
- public function providerHasAppKey(): array {
+ public static function providerHasAppKey(): array {
return [
// lazy, expected
[false, true],
@@ -57,11 +57,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerHasAppKey
*
* @param bool $lazy
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHasAppKey')]
public function testHasAppKey(bool $lazy, bool $expected): void {
$key = 'key';
$this->appConfigCore->expects($this->once())
@@ -76,7 +76,7 @@ class AppConfigTest extends TestCase {
* @return array
* @see testIsSensitive
*/
- public function providerIsSensitive(): array {
+ public static function providerIsSensitive(): array {
return [
// lazy, expected
[false, true],
@@ -87,11 +87,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerIsSensitive
*
* @param bool $lazy
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsSensitive')]
public function testIsSensitive(bool $lazy, bool $expected): void {
$key = 'key';
$this->appConfigCore->expects($this->once())
@@ -103,11 +103,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerIsSensitive
*
* @param bool $lazy
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsSensitive')]
public function testIsSensitiveException(bool $lazy, bool $expected): void {
$key = 'unknown-key';
$this->appConfigCore->expects($this->once())
@@ -123,7 +123,7 @@ class AppConfigTest extends TestCase {
* @return array
* @see testIsLazy
*/
- public function providerIsLazy(): array {
+ public static function providerIsLazy(): array {
return [
// expected
[true],
@@ -132,10 +132,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerIsLazy
- *
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsLazy')]
public function testIsLazy(bool $expected): void {
$key = 'key';
$this->appConfigCore->expects($this->once())
@@ -161,7 +160,7 @@ class AppConfigTest extends TestCase {
* @return array
* @see testGetAllAppValues
*/
- public function providerGetAllAppValues(): array {
+ public static function providerGetAllAppValues(): array {
return [
// key, filtered
['', false],
@@ -172,11 +171,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAllAppValues
*
* @param string $key
* @param bool $filtered
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAllAppValues')]
public function testGetAllAppValues(string $key, bool $filtered): void {
$expected = [
'key1' => 'value1',
@@ -214,7 +213,7 @@ class AppConfigTest extends TestCase {
* @see testSetAppValueArray
* @see testSetAppValueArrayException
*/
- public function providerSetAppValue(): array {
+ public static function providerSetAppValue(): array {
return [
// lazy, sensitive, expected
[false, false, true],
@@ -229,12 +228,12 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueString(bool $lazy, bool $sensitive, bool $expected): void {
$key = 'key';
$value = 'valueString';
@@ -247,11 +246,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueStringException(bool $lazy, bool $sensitive): void {
$key = 'key';
$value = 'valueString';
@@ -265,12 +264,12 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueInt(bool $lazy, bool $sensitive, bool $expected): void {
$key = 'key';
$value = 42;
@@ -283,11 +282,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueIntException(bool $lazy, bool $sensitive): void {
$key = 'key';
$value = 42;
@@ -301,12 +300,12 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueFloat(bool $lazy, bool $sensitive, bool $expected): void {
$key = 'key';
$value = 3.14;
@@ -319,11 +318,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueFloatException(bool $lazy, bool $sensitive): void {
$key = 'key';
$value = 3.14;
@@ -340,7 +339,7 @@ class AppConfigTest extends TestCase {
* @return array
* @see testSetAppValueBool
*/
- public function providerSetAppValueBool(): array {
+ public static function providerSetAppValueBool(): array {
return [
// lazy, expected
[false, true],
@@ -351,11 +350,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValueBool
*
* @param bool $lazy
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValueBool')]
public function testSetAppValueBool(bool $lazy, bool $expected): void {
$key = 'key';
$value = true;
@@ -368,10 +367,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValueBool
- *
* @param bool $lazy
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValueBool')]
public function testSetAppValueBoolException(bool $lazy): void {
$key = 'key';
$value = true;
@@ -385,12 +383,12 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueArray(bool $lazy, bool $sensitive, bool $expected): void {
$key = 'key';
$value = ['item' => true];
@@ -403,11 +401,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerSetAppValue
*
* @param bool $lazy
* @param bool $sensitive
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetAppValue')]
public function testSetAppValueArrayException(bool $lazy, bool $sensitive): void {
$key = 'key';
$value = ['item' => true];
@@ -456,7 +454,7 @@ class AppConfigTest extends TestCase {
* @see testGetAppValueArray
* @see testGetAppValueArrayException
*/
- public function providerGetAppValue(): array {
+ public static function providerGetAppValue(): array {
return [
// lazy, exist
[false, false],
@@ -467,11 +465,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
*
* @param bool $lazy
* @param bool $exist
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueString(bool $lazy, bool $exist): void {
$key = 'key';
$value = 'valueString';
@@ -487,10 +485,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
- *
* @param bool $lazy
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueStringException(bool $lazy): void {
$key = 'key';
$default = 'default';
@@ -505,11 +502,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
*
* @param bool $lazy
* @param bool $exist
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueInt(bool $lazy, bool $exist): void {
$key = 'key';
$value = 42;
@@ -525,10 +522,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
- *
* @param bool $lazy
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueIntException(bool $lazy): void {
$key = 'key';
$default = 17;
@@ -543,11 +539,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
*
* @param bool $lazy
* @param bool $exist
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueFloat(bool $lazy, bool $exist): void {
$key = 'key';
$value = 3.14;
@@ -563,10 +559,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
- *
* @param bool $lazy
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueFloatException(bool $lazy): void {
$key = 'key';
$default = 17.04;
@@ -581,11 +576,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
*
* @param bool $lazy
* @param bool $exist
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueBool(bool $lazy, bool $exist): void {
$key = 'key';
$value = true;
@@ -601,10 +596,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
- *
* @param bool $lazy
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueBoolException(bool $lazy): void {
$key = 'key';
$default = false;
@@ -619,11 +613,11 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
*
* @param bool $lazy
* @param bool $exist
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueArray(bool $lazy, bool $exist): void {
$key = 'key';
$value = ['item' => true];
@@ -639,10 +633,9 @@ class AppConfigTest extends TestCase {
}
/**
- * @dataProvider providerGetAppValue
- *
* @param bool $lazy
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetAppValue')]
public function testGetAppValueArrayException(bool $lazy): void {
$key = 'key';
$default = [];