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 +++++++++++++++++++++++++++++++ tests/UtilsTest.php | 31 ------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'tests') 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 */ diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 311d4bfb..4847ea94 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -138,37 +138,6 @@ class UtilsTest extends PHPUnit_Framework_TestCase $this->assertEquals('?', generateLocation($ref, 'localhost')); } - /** - * Check supported PHP versions - */ - public function testCheckSupportedPHPVersion() - { - $minVersion = '5.3'; - checkPHPVersion($minVersion, '5.4.32'); - checkPHPVersion($minVersion, '5.5'); - checkPHPVersion($minVersion, '5.6.10'); - } - - /** - * Check a unsupported PHP version - * @expectedException Exception - * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ - */ - public function testCheckSupportedPHPVersion51() - { - checkPHPVersion('5.3', '5.1.0'); - } - - /** - * Check another unsupported PHP version - * @expectedException Exception - * @expectedExceptionMessageRegExp /Your PHP version is obsolete/ - */ - public function testCheckSupportedPHPVersion52() - { - checkPHPVersion('5.3', '5.2'); - } - /** * Test is_session_id_valid with a valid ID - TEST ALL THE HASHES! * -- cgit v1.2.3