From 2421604aa16e3f953cc61bcfe228c5b6314685b0 Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Tue, 27 Aug 2019 11:21:41 +0200
Subject: [PATCH] Refactor per usare la classe FiltroExt

---
 tests/SetupUploadTest.php |   74 +++++++++++++++++++++++-------------
 1 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/tests/SetupUploadTest.php b/tests/SetupUploadTest.php
index 4792f03..a0ac041 100644
--- a/tests/SetupUploadTest.php
+++ b/tests/SetupUploadTest.php
@@ -1,16 +1,16 @@
 <?php
 
-require 'bootstrap.php';
 
 /**
  * Implementazione dei test per la classe SetupUpload
  *
  * @author Cristiano Magro
  */
-class SetupUploadTest extends PHPUnit_Framework_TestCase {
+class SetupUploadTest extends PHPUnit_Framework_TestCase
+{
 
     /**
-     *  @var $object SetupUpload 
+     * @var $object SetupUpload
      */
     protected $object;
 
@@ -18,7 +18,8 @@
      * Set up fixture, inizializzazione dei test.
      * Eseguito prima di ogni test
      */
-    protected function setUp() {
+    protected function setUp()
+    {
         $this->object = SetupUpload::create();
     }
 
@@ -26,19 +27,23 @@
      * Tears down the fixture, for example, closes a network connection.
      * This method is called after a test is executed.
      */
-    protected function tearDown() {
-        
+    protected function tearDown()
+    {
+
     }
 
-    public static function setUpBeforeClass() {
-        
+    public static function setUpBeforeClass()
+    {
+
     }
 
     /**
      * Conversione di una stringa nel corrispondente valore di byte
+     *
      * @since 0.3.0
      */
-    public function test_str2Bytes() {
+    public function test_str2Bytes()
+    {
 
         $this->assertEquals('1', SetupUpload::str2Bytes('1'));
         $this->assertEquals('1', SetupUpload::str2Bytes('1b'));
@@ -63,17 +68,20 @@
     }
 
     /**
-     * Conversione di una stringa nel corrispondente valore di byte, stringhe 
+     * 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
+     *
+     * @since             0.3.1
+     * @expectedException Upload_Exc_Error
+     * @dataProvider      getBytesStringNotValid
      */
-    public function test_str2BytesNonValido($byteString) {
+    public function test_str2BytesNonValido($byteString)
+    {
         SetupUpload::str2Bytes($byteString);
     }
 
-    public function getBytesStringNotValid() {
+    public function getBytesStringNotValid()
+    {
         return array(
             array(''),
             array('b'),
@@ -84,23 +92,28 @@
 
     /**
      * 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
+     * Gestione di valori non adeguati
+     *
+     * @since             0.3.1
+     * @expectedException Upload_Exc_Error
+     * @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),
@@ -111,15 +124,18 @@
 
     /**
      * Caselle della coda valide
-     * @since 0.3.1
+     *
+     * @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),
@@ -130,9 +146,11 @@
 
     /**
      * Impostazioni delle dimensioni massime del totale caricabile
+     *
      * @since 0.3.1
      */
-    public function testSetSizeMaxFilesByte() {
+    public function testSetSizeMaxFilesByte()
+    {
         $this->object->setSizeMaxFilesByte(100);
         $this->assertEquals(100, $this->object->getSizeMaxFilesByte());
 
@@ -145,9 +163,11 @@
 
     /**
      * Impostazioni delle dimensioni massime di un file
+     *
      * @since 0.3.1
      */
-    public function testSetSizeLimitFile() {
+    public function testSetSizeLimitFile()
+    {
         $this->object->setSizeLimitFile(100);
         $this->assertEquals(100, $this->object->getSizeLimitFile());
 

--
Gitblit v1.8.0