'-1', -1
],
['0', 0
],
['2mk', 2048
], // the unit must be the last char, so in this case 'k', not 'm'
];
} /**
* @dataProvider bytesProvider
*/
public function testFormatBytes(int
$bytes, string
$formatted): void
{ static::
assertEquals($formatted, MemorySizeCalculator::
formatToBytes($bytes));
} /**
* @return array<array{0: int, 1: string}>
*/
public static function bytesProvider(): array
{ return [ [0, '0 B'
],
[100, '100 B'
],
[1024, '1 KB'
],
[