X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FApplicationUtilsTest.php;h=6064357dcb50b70da959dc451271621392c449de;hb=6d03a9b2b38dd27c6df3127fcd2e24c686cab9df;hp=437c21fd14ba96fbffaed6c4157c66f4875075f0;hpb=1b740e3de39172975d0e755d9a089d2e9a44279d;p=github%2Fshaarli%2FShaarli.git 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 */