Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Convert
Test
Unit
DataSizeTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Convert\Test\Unit
;
8
9
use
Magento\Framework\Convert\DataSize
;
10
14
class
DataSizeTest
extends
\PHPUnit\Framework\TestCase
15
{
19
protected
$dataSize
;
20
26
protected
function
setUp
()
27
{
28
$this->dataSize =
new
DataSize
();
29
}
30
38
public
function
testConvertSizeToInteger
(
$value
, $expected)
39
{
40
$this->assertEquals($expected, $this->dataSize->convertSizeToBytes(
$value
));
41
}
42
46
public
function
getConvertSizeToIntegerDataProvider
()
47
{
48
return
[
49
[
'0K'
, 0],
50
[
'123K'
, 125952],
51
[
'1K'
, 1024],
52
[
'1g'
, 1073741824],
53
[
'asdas'
, 0],
54
[
'1M'
, 1048576]
55
];
56
}
57
}
Magento\Framework\Convert\Test\Unit\DataSizeTest\getConvertSizeToIntegerDataProvider
getConvertSizeToIntegerDataProvider()
Definition:
DataSizeTest.php:46
Magento\Framework\Convert\Test\Unit\DataSizeTest
Definition:
DataSizeTest.php:14
Magento\Framework\Convert\Test\Unit\DataSizeTest\testConvertSizeToInteger
testConvertSizeToInteger($value, $expected)
Definition:
DataSizeTest.php:38
Magento\Framework\Convert\Test\Unit
Definition:
ConvertArrayTest.php:7
Magento\Framework\Convert\DataSize
Definition:
DataSize.php:12
$value
$value
Definition:
gender.phtml:16
Magento\Framework\Convert\Test\Unit\DataSizeTest\$dataSize
$dataSize
Definition:
DataSizeTest.php:19
Magento\Framework\Convert\Test\Unit\DataSizeTest\setUp
setUp()
Definition:
DataSizeTest.php:26