25 $this->viewHelper = $this->getMock(
'TYPO3\CMS\Fluid\ViewHelpers\Format\BytesViewHelper', array(
'renderChildren'));
38 'decimalSeparator' => NULL,
39 'thousandsSeparator' => NULL,
45 'decimalSeparator' => NULL,
46 'thousandsSeparator' => NULL,
47 'expected' =>
'0.00 B' 52 'decimalSeparator' =>
',',
53 'thousandsSeparator' => NULL,
54 'expected' =>
'0,00 B' 60 'decimalSeparator' => NULL,
61 'thousandsSeparator' => NULL,
67 'decimalSeparator' => NULL,
68 'thousandsSeparator' => NULL,
69 'expected' =>
'42.0 KB' 74 'decimalSeparator' => NULL,
75 'thousandsSeparator' => NULL,
76 'expected' =>
'1.0 KB' 81 'decimalSeparator' => NULL,
82 'thousandsSeparator' => NULL,
83 'expected' =>
'1,023.00 B' 86 'value' => 1073741823,
88 'decimalSeparator' => NULL,
89 'thousandsSeparator' =>
'.',
90 'expected' =>
'1.024.0 MB' 93 'value' => pow(1024, 5),
95 'decimalSeparator' => NULL,
96 'thousandsSeparator' => NULL,
97 'expected' =>
'1.0 PB' 100 'value' => pow(1024, 8),
102 'decimalSeparator' => NULL,
103 'thousandsSeparator' => NULL,
104 'expected' =>
'1.0 YB' 119 $actualResult = $this->viewHelper->render($value, $decimals, $decimalSeparator, $thousandsSeparator);
120 $this->assertEquals($expected, $actualResult);
127 $this->viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(12345));
128 $actualResult = $this->viewHelper->render();
129 $this->assertEquals(
'12 KB', $actualResult);