]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/ApplicationUtilsTest.php
application: default to the "stable" branch for update checks
[github/shaarli/Shaarli.git] / tests / ApplicationUtilsTest.php
index 437c21fd14ba96fbffaed6c4157c66f4875075f0..6064357dcb50b70da959dc451271621392c449de 100644 (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
      */