protected function setUp(): void
{ $this->configGetCommand =
$this->
getConfigGetCommand();
} /**
* @dataProvider configFormatJsonProvider
*/
public function testConfigGetJson(string
$key, string
$format, string
$output): void
{ $commandOutput =
$this->
executeCommand($key,
$format);
static::
assertJsonStringEqualsJsonString($commandOutput,
$output);
} public static function configFormatJsonProvider(): \Generator
{ // config key, format, output
yield 'test scalar value' =>
['foo.bar.testBoolTrue', 'json', '{"foo.bar.testBoolTrue":true}'
];
yield 'test array' =>
['foo.bar', 'json', '{"testBoolFalse":false,"testInt":123,"testBoolTrue":true,"testString":"test"}'
];
yield 'test array and json-pretty format' =>
['foo.bar', 'json-pretty', '{"testBoolFalse":false,"testInt":123,"testBoolTrue":true,"testString":"test"}'
];
}