@@ -120,32 +120,19 @@ public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion() {
120120
121121	public  function  testGetWithNotExistingFileAndUpToDateTimestampAndVersion () {
122122		$ this config 
123- 			->expects ($ this at (0 ))
124- 			->method ('getSystemValue ' )
125- 			->with ('appstoreenabled ' , true )
126- 			->willReturn (true );
127- 		$ this config 
128- 			->expects ($ this at (1 ))
129- 			->method ('getSystemValue ' )
130- 			->with ('has_internet_connection ' , true )
131- 			->willReturn (true );
132- 		$ this config 
133- 			->expects ($ this at (2 ))
134- 			->method ('getSystemValue ' )
135- 			->with ('appstoreenabled ' , true )
136- 			->willReturn (true );
137- 		$ this config 
138- 			->expects ($ this at (3 ))
139123			->method ('getSystemValue ' )
140- 			->with ('appstoreurl ' , 'https://apps.nextcloud.com/api/v1 ' )
141- 			->willReturn ('https://apps.nextcloud.com/api/v1 ' );
142- 		$ this config 
143- 			->expects ($ this at (4 ))
144- 			->method ('getSystemValue ' )
145- 			->with (
146- 				$ this equalTo ('version ' ),
147- 				$ this anything ()
148- 			)->willReturn ('11.0.0.2 ' );
124+ 			->willReturnCallback (function  ($ var$ default
125+ 				if  ($ var'appstoreenabled ' ) {
126+ 					return  true ;
127+ 				} elseif  ($ var'has_internet_connection ' ) {
128+ 					return  true ;
129+ 				} elseif  ($ var'appstoreurl ' ) {
130+ 					return  'https://apps.nextcloud.com/api/v1 ' ;
131+ 				} elseif  ($ var'version ' ) {
132+ 					return  '11.0.0.2 ' ;
133+ 				}
134+ 				return  $ default
135+ 			});
149136
150137		$ folder$ this createMock (ISimpleFolder::class);
151138		$ file$ this createMock (ISimpleFile::class);
@@ -294,32 +281,19 @@ public function testGetWithAlreadyExistingFileAndOutdatedTimestamp() {
294281
295282	public  function  testGetWithAlreadyExistingFileAndNoVersion () {
296283		$ this config 
297- 			->expects ($ this at (0 ))
298- 			->method ('getSystemValue ' )
299- 			->with ('appstoreenabled ' , true )
300- 			->willReturn (true );
301- 		$ this config 
302- 			->expects ($ this at (1 ))
303- 			->method ('getSystemValue ' )
304- 			->with ('has_internet_connection ' , true )
305- 			->willReturn (true );
306- 		$ this config 
307- 			->expects ($ this at (2 ))
308- 			->method ('getSystemValue ' )
309- 			->with ('appstoreenabled ' , true )
310- 			->willReturn (true );
311- 		$ this config 
312- 			->expects ($ this at (3 ))
313284			->method ('getSystemValue ' )
314- 			->with ('appstoreurl ' , 'https://apps.nextcloud.com/api/v1 ' )
315- 			->willReturn ('https://apps.nextcloud.com/api/v1 ' );
316- 		$ this config 
317- 			->expects ($ this at (4 ))
318- 			->method ('getSystemValue ' )
319- 			->with (
320- 				$ this equalTo ('version ' ),
321- 				$ this anything ()
322- 			)->willReturn ('11.0.0.2 ' );
285+ 			->willReturnCallback (function  ($ var$ default
286+ 				if  ($ var'appstoreenabled ' ) {
287+ 					return  true ;
288+ 				} elseif  ($ var'has_internet_connection ' ) {
289+ 					return  true ;
290+ 				} elseif  ($ var'appstoreurl ' ) {
291+ 					return  'https://apps.nextcloud.com/api/v1 ' ;
292+ 				} elseif  ($ var'version ' ) {
293+ 					return  '11.0.0.2 ' ;
294+ 				}
295+ 				return  $ default
296+ 			});
323297
324298		$ folder$ this createMock (ISimpleFolder::class);
325299		$ file$ this createMock (ISimpleFile::class);
@@ -391,32 +365,19 @@ public function testGetWithAlreadyExistingFileAndNoVersion() {
391365
392366	public  function  testGetWithAlreadyExistingFileAndOutdatedVersion () {
393367		$ this config 
394- 			->expects ($ this at (0 ))
395- 			->method ('getSystemValue ' )
396- 			->with ('appstoreenabled ' , true )
397- 			->willReturn (true );
398- 		$ this config 
399- 			->expects ($ this at (1 ))
400368			->method ('getSystemValue ' )
401- 			->with ('has_internet_connection ' , true )
402- 			->willReturn (true );
403- 		$ this config 
404- 			->expects ($ this at (2 ))
405- 			->method ('getSystemValue ' )
406- 			->with ('appstoreenabled ' , true )
407- 			->willReturn (true );
408- 		$ this config 
409- 			->expects ($ this at (3 ))
410- 			->method ('getSystemValue ' )
411- 			->with ('appstoreurl ' , 'https://apps.nextcloud.com/api/v1 ' )
412- 			->willReturn ('https://apps.nextcloud.com/api/v1 ' );
413- 		$ this config 
414- 			->expects ($ this at (4 ))
415- 			->method ('getSystemValue ' )
416- 			->with (
417- 				$ this equalTo ('version ' ),
418- 				$ this anything ()
419- 			)->willReturn ('11.0.0.2 ' );
369+ 			->willReturnCallback (function  ($ var$ default
370+ 				if  ($ var'appstoreenabled ' ) {
371+ 					return  true ;
372+ 				} elseif  ($ var'has_internet_connection ' ) {
373+ 					return  true ;
374+ 				} elseif  ($ var'appstoreurl ' ) {
375+ 					return  'https://apps.nextcloud.com/api/v1 ' ;
376+ 				} elseif  ($ var'version ' ) {
377+ 					return  '11.0.0.2 ' ;
378+ 				}
379+ 				return  $ default
380+ 			});
420381
421382		$ folder$ this createMock (ISimpleFolder::class);
422383		$ file$ this createMock (ISimpleFile::class);
0 commit comments