]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix test
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 2 May 2017 09:38:21 +0000 (11:38 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 2 May 2017 09:38:21 +0000 (11:38 +0200)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tests/lib/App/AppStore/Fetcher/AppFetcherTest.php

index 4a5222fa915e4f2d8df665f2d5abad6578a97427..6c0d079a2041b0cecb8b40b6c7d7ca2332e4b9a0 100644 (file)
@@ -72,26 +72,16 @@ EOD;
        }
 
        public function testGetWithFilter() {
-               $this->config
-                       ->expects($this->at(0))
-                       ->method('getSystemValue')
-                       ->with('appstoreenabled', true)
-                       ->willReturn(true);
-               $this->config
-                       ->expects($this->at(1))
-                       ->method('getSystemValue')
-                       ->with('appstoreenabled', true)
-                       ->willReturn(true);
-               $this->config
-                       ->expects($this->at(2))
-                       ->method('getSystemValue')
-                       ->with('version')
-                       ->willReturn('11.0.0.2');
-               $this->config
-                       ->expects($this->at(3))
-                       ->method('getSystemValue')
-                       ->with('version')
-                       ->willReturn('11.0.0.2');
+               $this->config->method('getSystemValue')
+                       ->willReturnCallback(function($key, $default) {
+                               if ($key === 'appstoreenabled') {
+                                       return true;
+                               } else if ($key === 'version') {
+                                       return '11.0.0.2';
+                               } else {
+                                       return $default;
+                               }
+                       });
 
                $file = $this->createMock(ISimpleFile::class);
                $folder = $this->createMock(ISimpleFolder::class);