From 4407b45fd3b09257ea79edba8d4f50db350f8fa9 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Fri, 27 Nov 2015 00:10:43 +0100 Subject: application: default to the "stable" branch for update checks Relates to #372 Relates to #390 Signed-off-by: VirtualTam --- tests/ApplicationUtilsTest.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/ApplicationUtilsTest.php') diff --git a/tests/ApplicationUtilsTest.php b/tests/ApplicationUtilsTest.php index 437c21fd..6064357d 100644 --- a/tests/ApplicationUtilsTest.php +++ b/tests/ApplicationUtilsTest.php @@ -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 */ -- cgit v1.2.3