2 namespace TYPO3\CMS\Backend\Tests\Unit\Form;
17 use TYPO3\CMS\Core\Tests\UnitTestCase;
31 'format with empty format configuration' => array(
38 'format to date' => array(
45 'format to date with empty timestamp' => array(
52 'format to date with blank timestamp' => array(
59 'format to date with option strftime' => array(
70 'format to date with option' => array(
80 'format to datetime' => array(
82 'format' =>
'datetime',
87 'format to datetime with empty value' => array(
89 'format' =>
'datetime',
94 'format to datetime with null value' => array(
96 'format' =>
'datetime',
101 'format to time' => array(
108 'format to time with empty value' => array(
115 'format to time with null value' => array(
122 'format to timesec' => array(
124 'format' =>
'timesec',
129 'format to timesec with empty value' => array(
131 'format' =>
'timesec',
136 'format to timesec with null value' => array(
138 'format' =>
'timesec',
143 'format to year' => array(
150 'format to year with empty value' => array(
157 'format to year with null value' => array(
164 'format to int' => array(
171 'format to int with base' => array(
181 'format to int with empty value' => array(
188 'format to float' => array(
195 'format to float with precision' => array(
205 'format to float with empty value' => array(
212 'format to number' => array(
214 'format' =>
'number',
222 'format to number with empty option' => array(
224 'format' =>
'number',
229 'format to md5' => array(
234 'bacb98acf97e0b6112b1d1b650b84971'
236 'format to md5 with empty value' => array(
241 'd41d8cd98f00b204e9800998ecf8427e'
243 'format to filesize' => array(
245 'format' =>
'filesize',
250 'format to filesize with empty value' => array(
252 'format' =>
'filesize',
257 'format to filesize with option appendByteSize' => array(
259 'format' =>
'filesize',
261 'appendByteSize' =>
true,
277 public function formatValueWithGivenConfiguration($config, $itemValue, $expectedResult)
280 $subject = $this->getAccessibleMock(NoneElement::class, array(
'dummy'), array(),
'',
false);
281 $timezoneBackup = date_default_timezone_get();
282 date_default_timezone_set(
'UTC');
283 $result = $subject->_call(
'formatValue', $config, $itemValue);
284 date_default_timezone_set($timezoneBackup);
286 $this->assertEquals($expectedResult, $result);