From 371ed41c336704699febc7ad2c30e1d4886bf1c0 Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Tue, 16 Jan 2018 16:03:10 +0100
Subject: [PATCH] Elimino fossile

---
 tests/SetupUploadTest.php |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/tests/SetupUploadTest.php b/tests/SetupUploadTest.php
index 72d05eb..7ca6c4d 100644
--- a/tests/SetupUploadTest.php
+++ b/tests/SetupUploadTest.php
@@ -1,7 +1,5 @@
 <?php
 
-require 'bootstrap.php';
-
 /**
  * Implementazione dei test per la classe SetupUpload
  *
@@ -60,7 +58,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 Upload_Exc_Error
+     * @dataProvider getBytesStringNotValid
+     */
+    public function test_str2BytesNonValido($byteString) {
+        SetupUpload::str2Bytes($byteString);
+    }
+
+    public function getBytesStringNotValid() {
+        return array(
+            array(''),
+            array('b'),
+            array('1 k'),
+            array('1 a'),
+        );
     }
 
     /**
@@ -74,7 +91,7 @@
     /**
      * Gestione di valori non adeguati 
      * @since 0.3.1
-     * @expectedException UploadFile_Exc
+     * @expectedException Upload_Exc_Error
      * @dataProvider getNumMaxFilesException
      */
     public function testNotValidNumMaxFilesGetException($num) {

--
Gitblit v1.8.0