|
|
@@ -494,52 +494,4 @@ class NumberTest extends TestCase {
|
|
|
$this->assertEquals('512,05 GB', $result);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * testFromReadableSize
|
|
|
- *
|
|
|
- * @dataProvider filesizes
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function testFromReadableSize($params, $expected) {
|
|
|
- $result = $this->Number->fromReadableSize($params['size'], $params['default']);
|
|
|
- $this->assertEquals($expected, $result);
|
|
|
- }
|
|
|
-
|
|
|
-/**
|
|
|
- * testFromReadableSize
|
|
|
- *
|
|
|
- * @expectedException \Cake\Core\Exception\Exception
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function testFromReadableSizeException() {
|
|
|
- $this->Number->fromReadableSize('bogus', false);
|
|
|
- }
|
|
|
-
|
|
|
-/**
|
|
|
- * filesizes dataprovider
|
|
|
- *
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function filesizes() {
|
|
|
- return array(
|
|
|
- array(array('size' => '512B', 'default' => false), 512),
|
|
|
- array(array('size' => '1KB', 'default' => false), 1024),
|
|
|
- array(array('size' => '1.5KB', 'default' => false), 1536),
|
|
|
- array(array('size' => '1MB', 'default' => false), 1048576),
|
|
|
- array(array('size' => '1mb', 'default' => false), 1048576),
|
|
|
- array(array('size' => '1.5MB', 'default' => false), 1572864),
|
|
|
- array(array('size' => '1GB', 'default' => false), 1073741824),
|
|
|
- array(array('size' => '1.5GB', 'default' => false), 1610612736),
|
|
|
- array(array('size' => '1K', 'default' => false), 1024),
|
|
|
- array(array('size' => '1.5K', 'default' => false), 1536),
|
|
|
- array(array('size' => '1M', 'default' => false), 1048576),
|
|
|
- array(array('size' => '1m', 'default' => false), 1048576),
|
|
|
- array(array('size' => '1.5M', 'default' => false), 1572864),
|
|
|
- array(array('size' => '1G', 'default' => false), 1073741824),
|
|
|
- array(array('size' => '1.5G', 'default' => false), 1610612736),
|
|
|
- array(array('size' => '512', 'default' => 'Unknown type'), 512),
|
|
|
- array(array('size' => '2VB', 'default' => 'Unknown type'), 'Unknown type')
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
}
|