summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-05-02 11:38:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-05-02 11:38:21 +0200
commitae7c1504a9b2a3581025a4695c68dc95138db482 (patch)
tree5ac9758cf8956c3a7e967b8113142eaaf86f5d22 /tests
parente79424932a249b0e1568722ec0d709cd79a385ce (diff)
downloadnextcloud-server-ae7c1504a9b2a3581025a4695c68dc95138db482.tar.gz
nextcloud-server-ae7c1504a9b2a3581025a4695c68dc95138db482.zip
Fix test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/App/AppStore/Fetcher/AppFetcherTest.php30
1 files changed, 10 insertions, 20 deletions
diff --git a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
index 4a5222fa915..6c0d079a204 100644
--- a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
@@ -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);