diff --git a/phpunit/coverage/Database.php.html b/phpunit/coverage/Database.php.html
index 177a9f5..9e875c5 100755
--- a/phpunit/coverage/Database.php.html
+++ b/phpunit/coverage/Database.php.html
@@ -645,7 +645,7 @@
Dead Code
- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 9:10:21 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 13:45:11 UTC 2016.
diff --git a/phpunit/coverage/ManagerError.php.html b/phpunit/coverage/ManagerError.php.html
index aa77299..0ff813d 100755
--- a/phpunit/coverage/ManagerError.php.html
+++ b/phpunit/coverage/ManagerError.php.html
@@ -66,7 +66,7 @@
100.00% |
- 18 / 18 |
+ 19 / 19 |
@@ -87,7 +87,7 @@
100.00% |
1 / 1 |
- 18 |
+ 19 |
100.00% covered (success)
@@ -95,11 +95,11 @@
|
100.00% |
- 18 / 18 |
+ 19 / 19 |
- explicit |
+ explicit |
100.00% covered (success)
@@ -108,7 +108,7 @@
|
100.00% |
1 / 1 |
- 18 |
+ 19 |
100.00% covered (success)
@@ -116,7 +116,7 @@
|
100.00% |
- 18 / 18 |
+ 19 / 19 |
@@ -192,49 +192,53 @@
| |
| const PermissionError = 16; |
| |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | public static function explicit($error){ |
- | switch($error){ |
- | case self::Success: return "Tout s'est bien deroule"; break; |
- | |
- | case self::ParsingFailed: return "La lecture du fichier JSON ou XML a echoue"; break; |
- | |
- | case self::InvalidFlags: return "Les specifications (drapeaux) sont incorrects"; break; |
- | case self::UnreachableResource: return "La ressource n'existe pas (404)"; break; |
- | case self::MissingPath: return "Le chemin de delegation n'a pas ete renseigne"; break; |
- | case self::WrongPathModule: return "Le chemin de delegation est incorrect ('nomModule/nomMethode')"; break; |
- | case self::WrongPathRepo: return "Le chemin de delegation est incorrect ('nomRepo/nomMethode')"; break; |
- | case self::UnknownModule: return "Le module n'existe pas"; break; |
- | case self::UnknownRepo: return "Le repo n'existe pas"; break; |
- | case self::UnknownMethod: return "Le methode n'existe pas"; break; |
- | case self::UncallableMethod: return "Le methode n'est pas amorcable"; break; |
- | |
- | case self::ParamError: return "Un ou plusieurs parametres sont manquants ou incorrects"; break; |
- | case self::ModuleError: return "Erreur lors du traitement du module"; break; |
- | case self::RepoError: return "Erreur lors du traitement du repo"; break; |
- | |
- | case self::PDOConnection: return "La connexion avec la base de donnees a echoue"; break; |
- | |
- | case self::TokenError: return "Le token de connection est absent ou errone"; break; |
- | case self::PermissionError: return "Vous n'avez pas la permission d'effectuer cette action"; break; |
+ | |
+ | const UploadError = 17; |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | public static function explicit($error){ |
+ | switch($error){ |
+ | case self::Success: return "Tout s'est bien deroulé."; break; |
+ | |
+ | case self::ParsingFailed: return "La lecture du fichier JSON ou XML a echouée."; break; |
+ | |
+ | case self::InvalidFlags: return "Les spécifications (drapeaux) sont incorrects."; break; |
+ | case self::UnreachableResource: return "La ressource n'existe pas (404)."; break; |
+ | case self::MissingPath: return "Le chemin de délégation n'a pas été renseigné."; break; |
+ | case self::WrongPathModule: return "Le chemin de délégation est incorrect ('nomModule/nomMethode')."; break; |
+ | case self::WrongPathRepo: return "Le chemin de délégation est incorrect ('nomRepo/nomMethode')."; break; |
+ | case self::UnknownModule: return "Le module n'existe pas."; break; |
+ | case self::UnknownRepo: return "Le repo n'existe pas."; break; |
+ | case self::UnknownMethod: return "Le methode n'existe pas."; break; |
+ | case self::UncallableMethod: return "Le methode n'est pas amorçable."; break; |
+ | |
+ | case self::ParamError: return "Un ou plusieurs paramètres sont manquants ou incorrects."; break; |
+ | case self::ModuleError: return "Erreur lors du traitement du module."; break; |
+ | case self::RepoError: return "Erreur lors du traitement du repo."; break; |
+ | |
+ | case self::PDOConnection: return "La connexion avec la base de données a echouée."; break; |
| |
- | |
- | } |
- | |
- | |
- | return null; |
- | } |
+ | case self::TokenError: return "Le token de connection est absent, érroné ou expiré."; break; |
+ | case self::PermissionError: return "Vous n'avez pas la permission d'effectuer cette action."; break; |
+ | case self::UploadError: return "Une erreur d'upload est survenue."; break; |
+ | |
+ | |
+ | } |
| |
- | } |
- | |
- | ?> |
+ | |
+ | return null; |
+ | } |
+ | |
+ | } |
+ | |
+ | ?> |
@@ -247,7 +251,7 @@
Dead Code
- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 9:10:21 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 13:45:11 UTC 2016.
diff --git a/phpunit/coverage/ResourceDispatcher.php.html b/phpunit/coverage/ResourceDispatcher.php.html
index 64cd4fc..286a147 100755
--- a/phpunit/coverage/ResourceDispatcher.php.html
+++ b/phpunit/coverage/ResourceDispatcher.php.html
@@ -229,12 +229,12 @@
- | <?php |
+ | <?php |
| |
| namespace manager; |
| use \manager\Repo; |
| use \manager\sessionManager; |
- | |
+ | |
| |
| class ResourceDispatcher{ |
| |
@@ -280,7 +280,7 @@
| |
| |
| $parents_conf = json_decode( file_get_contents(__ROOT__.self::$parents_config_path), true ); |
- | |
+ | |
| |
| if( $parents_conf == null ){ |
| $this->error = ManagerError::ParsingFailed; |
@@ -314,7 +314,7 @@
| if( $view ) |
| $this->view(); |
| |
- | |
+ | |
| return true; |
| |
| } |
@@ -371,7 +371,7 @@
| if( !$correct ) |
| return false; |
| |
- | |
+ | |
| |
| |
| |
@@ -444,14 +444,14 @@
| $this->stylesheet .= "\t}\n"; |
| $this->stylesheet .= "</style>"; |
| } |
- | |
+ | |
| |
| |
| |
| |
| $this->header = $header; |
| |
- | |
+ | |
| |
| $this->path = __ROOT__.$parent.'/'.$opt_subParent.$this->flags['filename'].'.'.$this->flags['extension']; |
| |
@@ -517,7 +517,7 @@
Dead Code
- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 9:10:21 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 13:45:11 UTC 2016.
diff --git a/phpunit/coverage/autoloader.php.html b/phpunit/coverage/autoloader.php.html
index 11c303d..5daa646 100755
--- a/phpunit/coverage/autoloader.php.html
+++ b/phpunit/coverage/autoloader.php.html
@@ -214,7 +214,7 @@
Dead Code
- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 9:10:21 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 13:45:11 UTC 2016.
diff --git a/phpunit/coverage/index.html b/phpunit/coverage/index.html
index a6d40b9..2af40fd 100755
--- a/phpunit/coverage/index.html
+++ b/phpunit/coverage/index.html
@@ -43,13 +43,13 @@
Total |
-
- 64.97% covered (warning)
+
+ 65.21% covered (warning)
|
- 64.97% |
- 280 / 431 |
+ 65.21% |
+ 283 / 434 |
47.83% covered (danger)
@@ -161,7 +161,7 @@
|
100.00% |
- 18 / 18 |
+ 19 / 19 |
100.00% covered (success)
@@ -183,13 +183,13 @@
ModuleRequest.php |
-
- 86.81% covered (warning)
+
+ 87.10% covered (warning)
|
- 86.81% |
- 79 / 91 |
+ 87.10% |
+ 81 / 93 |
diff --git a/phpunit/coverage/sessionManager.php.html b/phpunit/coverage/sessionManager.php.html
index 508c90f..7e2bd09 100755
--- a/phpunit/coverage/sessionManager.php.html
+++ b/phpunit/coverage/sessionManager.php.html
@@ -315,7 +315,7 @@
Dead Code
- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 9:10:21 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Wed Apr 20 13:45:11 UTC 2016.
diff --git a/phpunit/tests/config.php b/phpunit/tests/config.php
index 5d6f383..ab1f475 100644
--- a/phpunit/tests/config.php
+++ b/phpunit/tests/config.php
@@ -13,8 +13,9 @@
'dispatcher-tree' => '../config/dispatcher-tree.json',
'menu' => '../config/menu.json',
'modules' => '../config/modules.json',
- 'repositories' => '../config/repositories.json',
- 'views' => '../config/views.json'
+ 'repositories' =>'../config/repositories.json',
+ 'upload-auth' =>'../config/upload-auth.json',
+ 'views' =>'../config/views.json'
);
/* [1] config/database-local.json
@@ -208,7 +209,26 @@
}
}
- /* [6] config/views.json
+ /* [6] config/upload-auth.json
+ =========================================================*/
+ public function testUploadAuth(){
+ /* (1) Lecture du fichier */
+ $file_content = file_get_contents( self::$config['upload-auth'] );
+ $this->assertNotFalse( $file_content );
+
+ /* (2) Parsage en JSON */
+ $json_content = json_decode( $file_content, true );
+ $this->assertNotNull( $json_content );
+
+ /* (3) Racine des uploads */
+ $this->assertTrue( isset($json_content['root']) );
+
+ /* (4) Liste des répertoires autorisés */
+ foreach($json_content['directories'] as $dir)
+ $this->assertTrue( preg_match('/^[a-z0-9_-]+$/', $dir) == true );
+ }
+
+ /* [7] config/views.json
=========================================================*/
public function testViews(){
/* (1) Lecture du fichier */
| |