Signed-off-by: Christian Wolf <git@christianwolf.email>
This commit is contained in:
Christian Wolf 2023-03-15 20:51:53 +01:00
Родитель 38d4a3c96e
Коммит 2684d2121f
1 изменённых файлов: 18 добавлений и 7 удалений

Просмотреть файл

@ -111,7 +111,7 @@ class ConfigImplementationTest extends TestCase {
* @param mixed $interval
* @param mixed $printImage
*/
public function testConfig($data, $folderPath, $interval, $printImage): void {
public function testConfig($data, $folderPath, $interval, $printImage, $visibleInfoBlocks): void {
$this->restParser->method('getParameters')->willReturn($data);
$this->dbCacheService->expects($this->once())->method('triggerCheck');
@ -136,6 +136,12 @@ class ConfigImplementationTest extends TestCase {
$this->recipeService->expects($this->once())->method('setPrintImage')->with($printImage);
}
if (is_null($visibleInfoBlocks)) {
$this->recipeService->expects($this->never())->method('setVisibleInfoBlocks');
} else {
$this->recipeService->expects($this->once())->method('setVisibleInfoBlocks')->with($visibleInfoBlocks);
}
/**
* @var JSONResponse $response
*/
@ -147,23 +153,28 @@ class ConfigImplementationTest extends TestCase {
public function dataProviderConfig() {
return [
'noChange' => [
[], null, null, null
[], null, null, null, null
],
'changeFolder' => [
['folder' => '/path/to/whatever'], '/path/to/whatever', null, null
['folder' => '/path/to/whatever'], '/path/to/whatever', null, null, null
],
'changeinterval' => [
['update_interval' => 15], null, 15, null
['update_interval' => 15], null, 15, null, null
],
'changePrint' => [
['print_image' => true], null, null, true
['print_image' => true], null, null, true, null
],
'changeVisibleBlocks' => [
['visibleInfoBlocks' => ['cooking-time' => true, 'preparation-time' => true]],
null, null, null, ['cooking-time' => true, 'preparation-time' => true]
],
'changeAll' => [
[
'folder' => '/my/custom/path',
'update_interval' => 12,
'print_image' => false
], '/my/custom/path', 12, false
'print_image' => false,
'visibleInfoBlocks' => ['cooking-time' => true, 'preparation-time' => true],
], '/my/custom/path', 12, false, ['cooking-time' => true, 'preparation-time' => true]
],
];
}