aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-03-29 09:44:38 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-04-11 10:08:23 +0200
commitac939e8fd4d6fd248a5ebf63a5e86edb6dcdaf3b (patch)
treee96bd35b06f85a1b9aa97d9a11f530b87bee2ec7 /tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
parentecc3bc64aab8c8e490492145a1c819c0e643638e (diff)
downloadnextcloud-server-ac939e8fd4d6fd248a5ebf63a5e86edb6dcdaf3b.tar.gz
nextcloud-server-ac939e8fd4d6fd248a5ebf63a5e86edb6dcdaf3b.zip
Fix version comparison with minor and patch level requirements
If an app requires a specific minor or path level server version, the version_compare prevented the installation as only the major version had been compared and that checks obviously returns `false`. Now the full version is used for comparison, making it possible to release apps for a specific minor or patch level version of Nextcloud. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/App/AppStore/Fetcher/AppFetcherTest.php')
-rw-r--r--tests/lib/App/AppStore/Fetcher/AppFetcherTest.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
index 4549b05935c..59dc7366cc0 100644
--- a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
@@ -22,6 +22,7 @@
namespace Test\App\AppStore\Fetcher;
use OC\App\AppStore\Fetcher\AppFetcher;
+use OC\App\CompareVersion;
use OC\Files\AppData\Factory;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\IAppData;
@@ -33,18 +34,21 @@ use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use OCP\IConfig;
use OCP\ILogger;
+use PHPUnit_Framework_MockObject_MockObject;
use Test\TestCase;
class AppFetcherTest extends TestCase {
- /** @var IAppData|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IAppData|PHPUnit_Framework_MockObject_MockObject */
protected $appData;
- /** @var IClientService|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IClientService|PHPUnit_Framework_MockObject_MockObject */
protected $clientService;
- /** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var ITimeFactory|PHPUnit_Framework_MockObject_MockObject */
protected $timeFactory;
- /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IConfig|PHPUnit_Framework_MockObject_MockObject */
protected $config;
- /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var CompareVersion|PHPUnit_Framework_MockObject_MockObject */
+ protected $compareVersion;
+ /** @var ILogger|PHPUnit_Framework_MockObject_MockObject */
protected $logger;
/** @var AppFetcher */
protected $fetcher;
@@ -57,7 +61,7 @@ EOD;
public function setUp() {
parent::setUp();
- /** @var Factory|\PHPUnit_Framework_MockObject_MockObject $factory */
+ /** @var Factory|PHPUnit_Framework_MockObject_MockObject $factory */
$factory = $this->createMock(Factory::class);
$this->appData = $this->createMock(IAppData::class);
$factory->expects($this->once())
@@ -67,6 +71,7 @@ EOD;
$this->clientService = $this->createMock(IClientService::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->config = $this->createMock(IConfig::class);
+ $this->compareVersion = new CompareVersion();
$this->logger = $this->createMock(ILogger::class);
$this->config
@@ -79,6 +84,7 @@ EOD;
$this->clientService,
$this->timeFactory,
$this->config,
+ $this->compareVersion,
$this->logger
);
}