Selaa lähdekoodia

Add unit tests for OC_Helper::phpFileSize function

tags/v7.0.0alpha2
Fabian Henze 10 vuotta sitten
vanhempi
commit
1245ff8f31
1 muutettua tiedostoa jossa 22 lisäystä ja 0 poistoa
  1. 22
    0
      tests/lib/helper.php

+ 22
- 0
tests/lib/helper.php Näytä tiedosto

@@ -30,6 +30,28 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
);
}

/**
* @dataProvider phpFileSizeProvider
*/
public function testPhpFileSize($expected, $input)
{
$result = OC_Helper::phpFileSize($input);
$this->assertEquals($expected, $result);
}

public function phpFileSizeProvider()
{
return array(
array('0B', 0),
array('1K', 1024),
array('9.5M', 10000000),
array('1.3G', 1395864371),
array('465.7G', 500000000000),
array('465661.3G', 500000000000000),
array('465661287.3G', 500000000000000000),
);
}

/**
* @dataProvider computerFileSizeProvider
*/

Loading…
Peruuta
Tallenna