]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use the mocked config version 2654/head
authorJoas Schilling <coding@schilljs.com>
Wed, 14 Dec 2016 09:45:27 +0000 (10:45 +0100)
committerJoas Schilling <coding@schilljs.com>
Wed, 14 Dec 2016 09:45:27 +0000 (10:45 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/App/AppStore/Fetcher/AppFetcher.php
tests/lib/App/AppStore/Fetcher/AppFetcherTest.php

index bbe75c723d53c0291cb84d7da5e0583a00d5d091..b8efdef433655c4d6d1bc7dbde067be12c0b4c7c 100644 (file)
@@ -50,7 +50,7 @@ class AppFetcher extends Fetcher {
                $this->fileName = 'apps.json';
                $this->config = $config;
 
-               $versionArray = \OC_Util::getVersion();
+               $versionArray = explode('.', $this->config->getSystemValue('version'));
                $this->endpointUrl = sprintf(
                        'https://apps.nextcloud.com/api/v1/platform/%d.%d.%d/apps.json',
                        $versionArray[0],
index aa0d50cac977e8e9765e3d1a60e0f423e5e16341..a9cd5a190d003dc18f731640c176ec780ea28c64 100644 (file)
@@ -58,6 +58,12 @@ EOD;
                $this->timeFactory = $this->createMock(ITimeFactory::class);
                $this->config = $this->createMock(IConfig::class);
 
+               $this->config
+                       ->expects($this->atLeastOnce())
+                       ->method('getSystemValue')
+                       ->with('version')
+                       ->willReturn('11.0.0.2');
+
                $this->fetcher = new AppFetcher(
                        $this->appData,
                        $this->clientService,
@@ -103,11 +109,6 @@ EOD;
                        ->expects($this->once())
                        ->method('getTime')
                        ->willReturn(1234);
-               $this->config
-                       ->expects($this->once())
-                       ->method('getSystemValue')
-                       ->with('version')
-                       ->willReturn('11.0.0.2');
 
                $expected = array (
                        'data' =>