[Pkg-owncloud-commits] [owncloud] 02/85: Add unit tests for OC_Helper::phpFileSize function

David Prévot taffit at moszumanska.debian.org
Tue Jun 17 19:12:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch 6.0
in repository owncloud.

commit 76cdd85cd990bd51de564512e2f5c8e6351dd660
Author: Fabian Henze <flyser42 at gmx.de>
Date:   Mon Apr 7 15:31:34 2014 +0200

    Add unit tests for OC_Helper::phpFileSize function
---
 tests/lib/helper.php | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 97547bc..f1d8691 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -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
 	 */
 	function testComputerFileSize($expected, $input) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list