From ee1a7b42cf449b82c8f5dc03e6a53f4b94bcc0cc Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Tue, 16 Jan 2018 15:59:25 +0100
Subject: [PATCH] Refactor sistemazione struttura libreria
---
/dev/null | 8 --------
phpunit.xml | 8 ++++++++
src/UploadFile/Exc/Error.php | 0
src/UploadFile/SetupUpload.class.php | 2 +-
tests/SetupUploadTest.php | 4 ++--
src/UploadFile/Autoloader.php | 2 +-
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644
index 0000000..32faf75
--- /dev/null
+++ b/phpunit.xml
@@ -0,0 +1,8 @@
+<phpunit bootstrap="src/UploadFile/autoloader.php"
+ stopOnFailure="true">
+ <testsuites>
+ <testsuite name="FileUpload">
+ <directory>tests/</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
\ No newline at end of file
diff --git a/src/UploadFile/Autoloader.php b/src/UploadFile/Autoloader.php
index 068b4f2..d1bf8e1 100644
--- a/src/UploadFile/Autoloader.php
+++ b/src/UploadFile/Autoloader.php
@@ -22,7 +22,7 @@
private static $classes = array(
'FileUpload' => 'FileUpload.class.php',
'SetupUpload' => 'SetupUpload.class.php',
- 'Upload_Exc_Error' => 'Upload_Exc_Error.class.php',
+ 'Upload_Exc_Error' => 'Exc/Error.php',
);
/**
diff --git a/src/UploadFile/Exc/Exc.php b/src/UploadFile/Exc/Error.php
similarity index 100%
rename from src/UploadFile/Exc/Exc.php
rename to src/UploadFile/Exc/Error.php
diff --git a/src/UploadFile/SetupUpload.class.php b/src/UploadFile/SetupUpload.class.php
index a143a0c..a0df8f6 100644
--- a/src/UploadFile/SetupUpload.class.php
+++ b/src/UploadFile/SetupUpload.class.php
@@ -131,7 +131,7 @@
*/
public function setNumMaxFiles($numero) {
if (!is_integer($numero) || $numero <= 0) {
- throw new UploadFile_Exc();
+ throw new Upload_Exc_Error();
}
$this->numMaxFiles = $numero;
diff --git a/tests/SetupUploadTest.php b/tests/SetupUploadTest.php
index 4792f03..50670ec 100644
--- a/tests/SetupUploadTest.php
+++ b/tests/SetupUploadTest.php
@@ -66,7 +66,7 @@
* Conversione di una stringa nel corrispondente valore di byte, stringhe
* non convertibili devono andare in errore
* @since 0.3.1
- * @expectedException UploadFile_Exc
+ * @expectedException Upload_Exc_Error
* @dataProvider getBytesStringNotValid
*/
public function test_str2BytesNonValido($byteString) {
@@ -93,7 +93,7 @@
/**
* Gestione di valori non adeguati
* @since 0.3.1
- * @expectedException UploadFile_Exc
+ * @expectedException Upload_Exc_Error
* @dataProvider getNumMaxFilesException
*/
public function testNotValidNumMaxFilesGetException($num) {
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
deleted file mode 100644
index 4dd54b1..0000000
--- a/tests/phpunit.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<phpunit bootstrap="bootstrap.php"
- stopOnFailure="true">
- <testsuites>
- <testsuite name="FileUpload">
- <directory>.</directory>
- </testsuite>
- </testsuites>
-</phpunit>
\ No newline at end of file
--
Gitblit v1.8.0