Browse Source

return true once one owncloud version number is bigger at any position

tags/v5.0.0RC1
Bernhard Posselt 11 years ago
parent
commit
f415f3e03e
2 changed files with 10 additions and 0 deletions
  1. 2
    0
      lib/app.php
  2. 8
    0
      tests/lib/app.php

+ 2
- 0
lib/app.php View File

@@ -885,6 +885,8 @@ class OC_App{

if($owncloudVersion < $appVersion){
return false;
} elseif ($owncloudVersion > $appVersion) {
return true;
}
}


+ 8
- 0
tests/lib/app.php View File

@@ -40,6 +40,14 @@ class Test_App extends PHPUnit_Framework_TestCase {
$this->assertTrue(OC_App::isAppVersionCompatible($oc, $app));
}


public function testIsAppVersionCompatibleComplex(){
$oc = array(5, 0, 0);
$app = '4.5.1';

$this->assertTrue(OC_App::isAppVersionCompatible($oc, $app));
}

public function testIsAppVersionCompatibleShouldFail(){
$oc = array(4, 3, 1);

Loading…
Cancel
Save