application: default to the "stable" branch for update checks

Relates to 
Relates to 

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2015-11-27 00:10:43 +01:00
parent 1b740e3de3
commit 4407b45fd3
4 changed files with 55 additions and 21 deletions

View file

@ -75,7 +75,7 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
public function testGetLatestGitVersionCodeInvalidUrl()
{
$this->assertFalse(
ApplicationUtils::getLatestGitVersionCode('htttp://null.io', 0)
ApplicationUtils::getLatestGitVersionCode('htttp://null.io', 1)
);
}
@ -102,7 +102,7 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
/**
* A newer version is available
*/
public function testCheckUpdateNewVersionNew()
public function testCheckUpdateNewVersionAvailable()
{
$newVersion = '1.8.3';
FakeApplicationUtils::$VERSION_CODE = $newVersion;
@ -134,6 +134,16 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase
$this->assertFalse($version);
}
/**
* Test update checks - invalid Git branch
* @expectedException Exception
* @expectedExceptionMessageRegExp /Invalid branch selected for updates/
*/
public function testCheckUpdateInvalidGitBranch()
{
ApplicationUtils::checkUpdate('', 'null', 0, true, true, 'unstable');
}
/**
* Shaarli is up-to-date
*/