From 1bbf00e0b86a22eeec58e6fc5961ed0f51f05fe2 Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Tue, 16 Jan 2018 15:48:57 +0100
Subject: [PATCH] Refactor inizio a sistemare la libreria in stile PSR-0
---
tests/SetupUploadTest.php | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/tests/SetupUploadTest.php b/tests/SetupUploadTest.php
index 72d05eb..4792f03 100644
--- a/tests/SetupUploadTest.php
+++ b/tests/SetupUploadTest.php
@@ -60,7 +60,26 @@
$this->assertEquals('0', SetupUpload::str2Bytes('0 mB'));
$this->assertEquals('0', SetupUpload::str2Bytes('0 GB'));
$this->assertEquals('0', SetupUpload::str2Bytes('0 TB'));
- $this->assertEquals('0', SetupUpload::str2Bytes('0 XB'));
+ }
+
+ /**
+ * Conversione di una stringa nel corrispondente valore di byte, stringhe
+ * non convertibili devono andare in errore
+ * @since 0.3.1
+ * @expectedException UploadFile_Exc
+ * @dataProvider getBytesStringNotValid
+ */
+ public function test_str2BytesNonValido($byteString) {
+ SetupUpload::str2Bytes($byteString);
+ }
+
+ public function getBytesStringNotValid() {
+ return array(
+ array(''),
+ array('b'),
+ array('1 k'),
+ array('1 a'),
+ );
}
/**
--
Gitblit v1.8.0