diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-07 16:03:36 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-07 16:03:36 +0100 |
commit | 9ca670f94f8598042f8dade216e0b1f67a8631c8 (patch) | |
tree | 1ff9cb3d9533141677eb1082d01edc2e3bc5aae4 /tests | |
parent | 601457d2217ec1ed18b49061e38d4cda3703c9f6 (diff) | |
parent | fd7ed939378d4c52218b75b1ef81773963163458 (diff) | |
download | nextcloud-server-9ca670f94f8598042f8dade216e0b1f67a8631c8.tar.gz nextcloud-server-9ca670f94f8598042f8dade216e0b1f67a8631c8.zip |
Merge pull request #21505 from owncloud/allow-downgrades-for-brave-developers
Allow downgrades for our brave developers, that switch between branches
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/updater.php | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/tests/lib/updater.php b/tests/lib/updater.php index 313ffb65738..8ee77b9f81e 100644 --- a/tests/lib/updater.php +++ b/tests/lib/updater.php @@ -27,7 +27,7 @@ use OCP\ILogger; use OC\IntegrityCheck\Checker; class UpdaterTest extends \Test\TestCase { - /** @var IConfig */ + /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ private $config; /** @var HTTPHelper */ private $httpHelper; @@ -136,9 +136,33 @@ class UpdaterTest extends \Test\TestCase { ['9.0.0.0', '8.0.0.0', '7.0', false], ['9.1.0.0', '8.0.0.0', '7.0', false], ['8.2.0.0', '8.1.0.0', '8.0', false], + + // With debug enabled + ['8.0.0.0', '8.2.0.0', '8.1', false, true], + ['8.1.0.0', '8.2.0.0', '8.1', true, true], + ['8.2.0.1', '8.2.0.1', '8.1', true, true], + ['8.3.0.0', '8.2.0.0', '8.1', true, true], ]; } + /** + * @dataProvider versionCompatibilityTestData + * + * @param string $oldVersion + * @param string $newVersion + * @param string $allowedVersion + * @param bool $result + * @param bool $debug + */ + public function testIsUpgradePossible($oldVersion, $newVersion, $allowedVersion, $result, $debug = false) { + $this->config->expects($this->any()) + ->method('getSystemValue') + ->with('debug', false) + ->willReturn($debug); + + $this->assertSame($result, $this->updater->isUpgradePossible($oldVersion, $newVersion, $allowedVersion)); + } + public function testSetSimulateStepEnabled() { $this->updater->setSimulateStepEnabled(true); $this->assertSame(true, $this->invokePrivate($this->updater, 'simulateStepEnabled')); @@ -160,18 +184,6 @@ class UpdaterTest extends \Test\TestCase { $this->assertSame(false, $this->invokePrivate($this->updater, 'skip3rdPartyAppsDisable')); } - /** - * @dataProvider versionCompatibilityTestData - * - * @param string $oldVersion - * @param string $newVersion - * @param string $allowedVersion - * @param bool $result - */ - public function testIsUpgradePossible($oldVersion, $newVersion, $allowedVersion, $result) { - $this->assertSame($result, $this->updater->isUpgradePossible($oldVersion, $newVersion, $allowedVersion)); - } - public function testCheckInCache() { $expectedResult = [ 'version' => '8.0.4.2', |