2014-09-18 19:45:30 +04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OC;
|
|
|
|
|
2014-11-11 00:59:50 +03:00
|
|
|
class UpdaterTest extends \Test\TestCase {
|
2014-09-18 19:45:30 +04:00
|
|
|
|
2014-11-21 12:48:05 +03:00
|
|
|
public function versionCompatibilityTestData() {
|
2014-09-18 19:45:30 +04:00
|
|
|
return array(
|
|
|
|
array('1.0.0.0', '2.2.0', true),
|
|
|
|
array('1.1.1.1', '2.0.0', true),
|
|
|
|
array('5.0.3', '4.0.3', false),
|
|
|
|
array('12.0.3', '13.4.5', true),
|
|
|
|
array('1', '2', true),
|
|
|
|
array('2', '2', true),
|
|
|
|
array('6.0.5', '6.0.6', true),
|
|
|
|
array('5.0.6', '7.0.4', false)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-21 12:48:05 +03:00
|
|
|
* @dataProvider versionCompatibilityTestData
|
2014-09-18 19:45:30 +04:00
|
|
|
*/
|
|
|
|
function testIsUpgradePossible($oldVersion, $newVersion, $result) {
|
|
|
|
$updater = new Updater();
|
|
|
|
$this->assertSame($result, $updater->isUpgradePossible($oldVersion, $newVersion));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|