Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DataSizeTest.php
Go to the documentation of this file.
1 <?php
8 
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 
47  {
48  return [
49  ['0K', 0],
50  ['123K', 125952],
51  ['1K', 1024],
52  ['1g', 1073741824],
53  ['asdas', 0],
54  ['1M', 1048576]
55  ];
56  }
57 }
$value
Definition: gender.phtml:16