mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Merge branch 'support/2.7' into develop
# Conflicts: # README.md # composer.json # composer.lock # core/cmdbsource.class.inc.php # core/dbobject.class.php # datamodels/2.x/combodo-db-tools/db_analyzer.class.inc.php # datamodels/2.x/combodo-db-tools/dbtools.php # datamodels/2.x/combodo-db-tools/dictionaries/zh_cn.dict.combodo-db-tools.php # datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php # datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php # dictionaries/zh_cn.dictionary.itop.core.php # dictionaries/zh_cn.dictionary.itop.ui.php # lib/composer/InstalledVersions.php # lib/composer/autoload_classmap.php # lib/composer/autoload_static.php # lib/composer/installed.php # lib/composer/platform_check.php # pages/ajax.render.php # pages/csvimport.php # setup/ajax.dataloader.php # setup/index.php # setup/setuputils.class.inc.php # test/application/UtilsTest.php
This commit is contained in:
@@ -54,11 +54,10 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
public function memoryLimitDataProvider()
|
||||
{
|
||||
return [
|
||||
[true, '-1', 1024],
|
||||
[true, -1, 1024],
|
||||
[true, 1024, 1024],
|
||||
[true, 2048, 1024],
|
||||
[false, 1024, 2048],
|
||||
'current -1, required 1024' => [true, -1, 1024],
|
||||
'current 1024, required 1024' => [true, 1024, 1024],
|
||||
'current 2048, required 1024' => [true, 2048, 1024],
|
||||
'current 1024, required 2048' => [false, 1024, 2048],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -552,4 +551,26 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sExpressionToConvert
|
||||
* @param int $iExpectedConvertedValue
|
||||
*
|
||||
* @dataProvider ConvertToBytesProvider
|
||||
*/
|
||||
public function testConvertToBytes($sExpressionToConvert, $iExpectedConvertedValue)
|
||||
{
|
||||
$iCurrentConvertedValue = utils::ConvertToBytes($sExpressionToConvert);
|
||||
self::assertEquals($iExpectedConvertedValue, $iCurrentConvertedValue, 'Converted value wasn\'t the one expected !');
|
||||
}
|
||||
|
||||
public function ConvertToBytesProvider()
|
||||
{
|
||||
return [
|
||||
'123' => ['123', 123],
|
||||
'56k' => ['56k', 56 * 1024],
|
||||
'512M' => ['512M', 512 * 1024 * 1024],
|
||||
'2G' => ['2G', 2 * 1024 * 1024 * 1024],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user