X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FApplicationUtilsTest.php;h=a232b351f4cfdae5c63c4d31553f055500a4111b;hb=f447edb73b1bcb52e86286467d3ec7b7bdc29948;hp=ff4c9e17944be6de5fa9e53f9574eb1baac5c665;hpb=f9ff7f1b69f19b42569ffa67280807ba56f5d48a;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/ApplicationUtilsTest.php b/tests/ApplicationUtilsTest.php index ff4c9e17..a232b351 100644 --- a/tests/ApplicationUtilsTest.php +++ b/tests/ApplicationUtilsTest.php @@ -1,33 +1,14 @@ expectException(\Exception::class); + $this->expectExceptionMessageRegExp('/Invalid branch selected for updates/'); + ApplicationUtils::checkUpdate('', 'null', 0, true, true, 'unstable'); } @@ -272,29 +254,31 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase public function testCheckSupportedPHPVersion() { $minVersion = '5.3'; - ApplicationUtils::checkPHPVersion($minVersion, '5.4.32'); - ApplicationUtils::checkPHPVersion($minVersion, '5.5'); - ApplicationUtils::checkPHPVersion($minVersion, '5.6.10'); + $this->assertTrue(ApplicationUtils::checkPHPVersion($minVersion, '5.4.32')); + $this->assertTrue(ApplicationUtils::checkPHPVersion($minVersion, '5.5')); + $this->assertTrue(ApplicationUtils::checkPHPVersion($minVersion, '5.6.10')); } /** * Check a unsupported PHP version - * @expectedException Exception - * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ */ public function testCheckSupportedPHPVersion51() { - ApplicationUtils::checkPHPVersion('5.3', '5.1.0'); + $this->expectException(\Exception::class); + $this->expectExceptionMessageRegExp('/Your PHP version is obsolete/'); + + $this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.1.0')); } /** * Check another unsupported PHP version - * @expectedException Exception - * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ */ public function testCheckSupportedPHPVersion52() { - ApplicationUtils::checkPHPVersion('5.3', '5.2'); + $this->expectException(\Exception::class); + $this->expectExceptionMessageRegExp('/Your PHP version is obsolete/'); + + $this->assertTrue(ApplicationUtils::checkPHPVersion('5.3', '5.2')); } /**