]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/include/utils/CheckPhpVersionTest.php
Added unit tests.
[Github/sugarcrm.git] / tests / include / utils / CheckPhpVersionTest.php
1 <?php
2
3 class CheckPHPVersionTest extends Sugar_PHPUnit_Framework_TestCase
4 {
5     public function providerPhpVersion()
6     {
7         return array(
8             array('4.2.1',-1,'Invalid version below min check failed.'),
9             array('5.2.1',1,'Minimum valid version check failed.'),
10             array('5.2.7',-1,'Unsupported version check failed.'),
11             array('5.2.0-rh',1,'Unsupported custom version check failed as invalid'),
12             array('5.2.0-gentoo',-1,'Unsupported custom version check failed as invalid'),
13             array('5.2.8',1,'Supported version check failed.'),
14             array('5.3.0',1,'Supported version check failed.'),
15             array('5.0.0',-1,'Invalid version check failed.'),
16             array('7.9.5',0,'Unsupported future version check failed.'),
17             );
18     }
19     
20     /**
21      * @dataProvider providerPhpVersion
22      * @group bug33202
23      */
24         public function testPhpVersion(
25             $ver, 
26             $expected_retval, 
27             $message
28             )
29         {
30                 $this->assertEquals($expected_retval, check_php_version($ver), $message);
31         }
32 }