From c1ead938f264d9632c4bb9a6ff7d67f41708203a Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Wed, 03 Jan 2018 17:37:43 +0100
Subject: [PATCH] [test] setup limiti files con conversione stringa in byte

---
 tests/SetupUploadTest.php |   48 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/tests/SetupUploadTest.php b/tests/SetupUploadTest.php
index 92d0308..72d05eb 100644
--- a/tests/SetupUploadTest.php
+++ b/tests/SetupUploadTest.php
@@ -67,21 +67,21 @@
      * La coda non inizializzata prevede un numero minimo di files
      * @since 0.3.1
      */
-    public function testDefaultValue(){
+    public function testDefaultValue() {
         $this->assertEquals(1, $this->object->getNumMaxFiles());
     }
-    
+
     /**
      * Gestione di valori non adeguati 
      * @since 0.3.1
      * @expectedException UploadFile_Exc
      * @dataProvider getNumMaxFilesException
      */
-    public function testNotValidNumMaxFilesGetException($num){
+    public function testNotValidNumMaxFilesGetException($num) {
         $this->object->setNumMaxFiles($num);
     }
-    
-    public function getNumMaxFilesException () {
+
+    public function getNumMaxFilesException() {
         return array(
             array(''),
             array(0),
@@ -95,12 +95,12 @@
      * @since 0.3.1
      * @dataProvider getSomeMaxFiles
      */
-    public function testSomeValidMaxFiles($num){
+    public function testSomeValidMaxFiles($num) {
         $this->object->setNumMaxFiles($num);
         $this->assertEquals($num, $this->object->getNumMaxFiles());
     }
-    
-    public function getSomeMaxFiles () {
+
+    public function getSomeMaxFiles() {
         return array(
             array(2),
             array(020),
@@ -108,5 +108,35 @@
             array(10000),
         );
     }
-    
+
+    /**
+     * Impostazioni delle dimensioni massime del totale caricabile
+     * @since 0.3.1
+     */
+    public function testSetSizeMaxFilesByte() {
+        $this->object->setSizeMaxFilesByte(100);
+        $this->assertEquals(100, $this->object->getSizeMaxFilesByte());
+
+        $this->object->setSizeMaxFilesByte('200');
+        $this->assertEquals(200, $this->object->getSizeMaxFilesByte());
+
+        $this->object->setSizeMaxFilesByte('3 kb');
+        $this->assertEquals(1024 * 3, $this->object->getSizeMaxFilesByte());
+    }
+
+    /**
+     * Impostazioni delle dimensioni massime di un file
+     * @since 0.3.1
+     */
+    public function testSetSizeLimitFile() {
+        $this->object->setSizeLimitFile(100);
+        $this->assertEquals(100, $this->object->getSizeLimitFile());
+
+        $this->object->setSizeLimitFile('200');
+        $this->assertEquals(200, $this->object->getSizeLimitFile());
+
+        $this->object->setSizeLimitFile('3kb');
+        $this->assertEquals(1024 * 3, $this->object->getSizeLimitFile());
+    }
+
 }

--
Gitblit v1.8.0