From c9cf2715f0ec10d51d881d386de9fa818f76af46 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Tue, 24 Nov 2015 01:36:12 +0100 Subject: application: move checkPHPVersion from Utils to ApplicationUtils Relates to #372 Signed-off-by: VirtualTam --- tests/ApplicationUtilsTest.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests/ApplicationUtilsTest.php') diff --git a/tests/ApplicationUtilsTest.php b/tests/ApplicationUtilsTest.php index 9a99c6c6..01301e68 100644 --- a/tests/ApplicationUtilsTest.php +++ b/tests/ApplicationUtilsTest.php @@ -11,6 +11,37 @@ require_once 'application/ApplicationUtils.php'; */ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase { + /** + * Check supported PHP versions + */ + public function testCheckSupportedPHPVersion() + { + $minVersion = '5.3'; + ApplicationUtils::checkPHPVersion($minVersion, '5.4.32'); + ApplicationUtils::checkPHPVersion($minVersion, '5.5'); + 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'); + } + + /** + * Check another unsupported PHP version + * @expectedException Exception + * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ + */ + public function testCheckSupportedPHPVersion52() + { + ApplicationUtils::checkPHPVersion('5.3', '5.2'); + } + /** * Checks resource permissions for the current Shaarli installation */ -- cgit v1.2.3