FormatBytesViewHelperTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFormatBytes() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers;
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
use TYPO3\CMS\Fluid\View\StandaloneView;
19
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
20
21
class FormatBytesViewHelperTest extends FunctionalTestCase
22
{
23
    /**
24
     * @var array
25
     */
26
    protected $testExtensionsToLoad = ['typo3conf/ext/qbtools'];
27
28
    /**
29
     * @var array
30
     */
31
    protected $coreExtensionsToLoad = ['fluid'];
32
33
    public function testFormatBytes()
34
    {
35
        $view = new StandaloneView();
36
        $view->setTemplatePathAndFilename('typo3conf/ext/qbtools/Tests/Functional/ViewHelpers/Fixtures/formatbytes_viewhelper.html');
37
38
        $expected = '10, 100, 1 k, 1 k, 1 M, 1 G, 1 T';
39
        $this->assertEquals($expected, trim(preg_replace('/\s+/', ' ', $view->render())));
40
    }
41
}
42