MDL-27759 backport some improvs from master + whitespace fix

This commit is contained in:
Eloy Lafuente (stronk7)
2011-06-14 17:07:03 +02:00
parent 87c8b752ca
commit 91c59dbd8e
2 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -274,7 +274,7 @@ define('PARAM_MULTILANG', 'text');
/**
* PARAM_TIMEZONE - expected timezone. Timezone can be int +-(0-13) or float +-(0.5-12.5) or
* string seperated by '/' and can have '-' &/ '_' (eg. America/North_Dakota/New_Salem
* string seperated by '/' and can have '-' &/ '_' (eg. America/North_Dakota/New_Salem
* America/Port-au-Prince)
*/
define('PARAM_TIMEZONE', 'timezone');
+13 -13
View File
@@ -451,22 +451,22 @@ class moodlelib_test extends UnitTestCase {
'America/Argentina/Cordoba' => 'America/Argentina/Cordoba',
'America/Port-au-Prince' => 'America/Port-au-Prince',
'America/Argentina/Buenos_Aires' => 'America/Argentina/Buenos_Aires',
'Wrong.Value' => '',
'Wrong/.Value' => '',
'Wrong(Value)' => '',
'0' => '0',
'0.0' => '0.0',
'0.5' => '0.5',
'-12.5' => '-12.5',
'+12.5' => '+12.5',
'13.5' => '',
'-13.5' => '',
'0.2' => '');
'PST8PDT' => 'PST8PDT',
'Wrong.Value' => '',
'Wrong/.Value' => '',
'Wrong(Value)' => '',
'0' => '0',
'0.0' => '0.0',
'0.5' => '0.5',
'-12.5' => '-12.5',
'+12.5' => '+12.5',
'13.5' => '',
'-13.5' => '',
'0.2' => '');
foreach ($testvalues as $testvalue => $expectedvalue) {
$actualvalue = clean_param($testvalue, PARAM_TIMEZONE);
$this->assertEqual($actualvalue, $expectedvalue,
"Expected value: {$expectedvalue} => Actual value: {$actualvalue}");
$this->assertEqual($actualvalue, $expectedvalue);
}
}