322b1208811b3c183fb1e8afade3aa0fb0143f7d
[Packages/TYPO3.CMS.git] / tests / t3lib / utility / class.t3lib_utility_versionNumberTest.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2011 Susanne Moog <typo3@susanne-moog.de>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * Testcase for class t3lib_utility_VersionNumber
27 *
28 * @author Susanne Moog <typo3@susanne-moog.de>
29 *
30 * @package TYPO3
31 * @subpackage t3lib
32 */
33
34 class t3lib_utility_VersionNumberTest extends tx_phpunit_testcase {
35
36 //////////////////////////////////
37 // Tests concerning int_from_ver
38 //////////////////////////////////
39 /**
40 * Data Provider for convertVersionNumberToIntegerConvertsVersionNumbersToIntegersDataProvider
41 *
42 * return array
43 */
44 public function convertVersionNumberToIntegerConvertsVersionNumbersToIntegersDataProvider() {
45 return array(
46 array('4003003', '4.3.3'),
47 array('4012003', '4.12.3'),
48 array('5000000', '5.0.0'),
49 array('3008001', '3.8.1'),
50 array('1012', '0.1.12')
51 );
52 }
53
54 /**
55 * @test
56 * @dataProvider convertVersionNumberToIntegerConvertsVersionNumbersToIntegersDataProvider
57 */
58 public function convertVersionNumberToIntegerConvertsVersionNumbersToIntegers($expected, $version) {
59 $this->assertEquals($expected, t3lib_utility_VersionNumber::convertVersionNumberToInteger($version));
60 }
61
62 }
63
64 ?>