From 81fcbde79464b6c5e39c62647276c6b2a60fbbb5 Mon Sep 17 00:00:00 2001
From: xdrm-brackets
- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 15:49:45 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Mon Apr 18 6:41:06 UTC 2016.
diff --git a/phpunit/coverage/ManagerError.php.html b/phpunit/coverage/ManagerError.php.html index 4c46407..51d9c4c 100755 --- a/phpunit/coverage/ManagerError.php.html +++ b/phpunit/coverage/ManagerError.php.html @@ -247,7 +247,7 @@ Dead Code- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 15:49:45 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Mon Apr 18 6:41:06 UTC 2016.
diff --git a/phpunit/coverage/ResourceDispatcher.php.html b/phpunit/coverage/ResourceDispatcher.php.html index 81c0443..0fd0aff 100755 --- a/phpunit/coverage/ResourceDispatcher.php.html +++ b/phpunit/coverage/ResourceDispatcher.php.html @@ -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 Sun Apr 17 15:49:45 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Mon Apr 18 6:41:06 UTC 2016.
diff --git a/phpunit/coverage/autoloader.php.html b/phpunit/coverage/autoloader.php.html index 5b9b035..edb67cf 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 Sun Apr 17 15:49:45 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Mon Apr 18 6:41:06 UTC 2016.
diff --git a/phpunit/coverage/index.html b/phpunit/coverage/index.html index a017ae1..0c88c4e 100755 --- a/phpunit/coverage/index.html +++ b/phpunit/coverage/index.html @@ -210,7 +210,7 @@ High: 90% to 100%- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 15:49:45 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Mon Apr 18 6:41:06 UTC 2016.
diff --git a/phpunit/coverage/sessionManager.php.html b/phpunit/coverage/sessionManager.php.html index 3103e3f..718c853 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 Sun Apr 17 15:49:45 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Mon Apr 18 6:41:06 UTC 2016.
diff --git a/phpunit/tests/config.php b/phpunit/tests/config.php index 16e5c26..5d6f383 100644 --- a/phpunit/tests/config.php +++ b/phpunit/tests/config.php @@ -23,16 +23,16 @@ /* (1) Lecture du fichier */ $file_content = file_get_contents( self::$config['database-local'] ); $this->assertNotFalse( $file_content ); - + /* (2) Parsage en JSON */ $json_content = json_decode( $file_content, true ); $this->assertNotNull( $json_content ); /* (3) Contenu */ - $this->assertArrayHasKey('host', $json_content); - $this->assertArrayHasKey('dbname', $json_content); - $this->assertArrayHasKey('user', $json_content); - $this->assertArrayHasKey('password', $json_content); + $this->assertArrayHasKey('host',$json_content); + $this->assertArrayHasKey('dbname',$json_content); + $this->assertArrayHasKey('user',$json_content); + $this->assertArrayHasKey('password',$json_content); } @@ -43,7 +43,7 @@ /* (1) Lecture du fichier */ $file_content = file_get_contents( self::$config['database'] ); $this->assertNotFalse( $file_content ); - + /* (2) Parsage en JSON */ $json_content = json_decode( $file_content, true ); $this->assertNotNull( $json_content ); @@ -63,7 +63,7 @@ /* (1) Lecture du fichier */ $file_content = file_get_contents( self::$config['dispatcher-extensions'] ); $this->assertNotFalse( $file_content ); - + /* (2) Parsage en JSON */ $json_content = json_decode( $file_content, true ); $this->assertNotNull( $json_content ); @@ -81,14 +81,13 @@ } - /* [3] config/dispatcher-tree.json =========================================================*/ public function testDispatcherTree(){ /* (1) Lecture du fichier */ $file_content = file_get_contents( self::$config['dispatcher-tree'] ); $this->assertNotFalse( $file_content ); - + /* (2) Parsage en JSON */ $json_content = json_decode( $file_content, true ); $this->assertNotNull( $json_content ); @@ -106,28 +105,128 @@ } - /* [3] config/menu.json =========================================================*/ public function testMenu(){ /* (1) Lecture du fichier */ $file_content = file_get_contents( self::$config['menu'] ); $this->assertNotFalse( $file_content ); - + /* (2) Parsage en JSON */ $json_content = json_decode( $file_content, true ); $this->assertNotNull( $json_content ); - - - /* (3) Contenu */ + /* (3) Contenu de chaque catégorie */ foreach($json_content as $category){ - continue; + $this->assertArrayHasKey( 'icon', $category ); + $this->assertTrue( is_string($category['icon']) ); + $this->assertArrayHasKey( 'text', $category ); + $this->assertTrue( is_string($category['text']) ); + $this->assertArrayHasKey( 'attributes', $category ); + $this->assertTrue( is_array($category['attributes']) ); + $this->assertArrayHasKey( 'children', $category ); + $this->assertTrue( is_array($category['children']) ); + + /* (4) Contenu de chaque sous-catégorie */ + foreach($category['children'] as $children){ + $this->assertArrayHasKey( 'permissions', $children ); + $this->assertTrue( is_array($children['permissions']) ); + $this->assertArrayHasKey( 'text', $children ); + $this->assertTrue( is_string($children['text']) ); + $this->assertArrayHasKey( 'attributes', $children ); + $this->assertTrue( is_array($children['attributes']) ); + } + + } + } + + /* [4] config/modules.json + =========================================================*/ + public function testModules(){ + /* (1) Lecture du fichier */ + $file_content = file_get_contents( self::$config['modules'] ); + $this->assertNotFalse( $file_content ); + + /* (2) Parsage en JSON */ + $json_content = json_decode( $file_content, true ); + $this->assertNotNull( $json_content ); + + /* (3) Contenu de chaque module */ + foreach($json_content as $moduleName=>$methods){ + $this->assertTrue( is_string($moduleName) ); + + /* (4) Liste des méthodes du module */ + foreach($methods as $methodName=>$method){ + $this->assertTrue( is_string($methodName) ); + + $this->assertArrayHasKey( 'description', $method ); + $this->assertTrue( is_string($method['description']) ); + $this->assertArrayHasKey( 'permissions', $method ); + $this->assertTrue( is_array($method['permissions']) ); + $this->assertArrayHasKey( 'parameters', $method ); + $this->assertTrue( is_array($method['parameters']) ); + + /* (5) Pour chaque paramètre */ + foreach($method['parameters'] as $parameterName=>$parameter){ + $this->assertTrue( is_string($parameterName) ); + + $this->assertArrayHasKey( 'description', $parameter ); + $this->assertTrue( is_string($parameter['description']) ); + + $typeIsDefined = isset($parameter['type']); + + if( $typeIsDefined ) + $this->assertTrue( is_string($parameter['type']) ); + } + + } + } } + /* [5] config/repositories.json + =========================================================*/ + public function testRepositories(){ + /* (1) Lecture du fichier */ + $file_content = file_get_contents( self::$config['repositories'] ); + $this->assertNotFalse( $file_content ); + + /* (2) Parsage en JSON */ + $json_content = json_decode( $file_content, true ); + $this->assertNotNull( $json_content ); + + /* (3) Contenu de chaque repository */ + foreach($json_content as $repoName=>$methods){ + $this->assertTrue( is_string($repoName) ); + + /* (4) Liste des méthodes du repository */ + foreach($methods as $methodName) + $this->assertTrue( is_string($methodName) ); + + } + } + + /* [6] config/views.json + =========================================================*/ + public function testViews(){ + /* (1) Lecture du fichier */ + $file_content = file_get_contents( self::$config['views'] ); + $this->assertNotFalse( $file_content ); + + /* (2) Parsage en JSON */ + $json_content = json_decode( $file_content, true ); + $this->assertNotNull( $json_content ); + + /* (3) Contenu de chaque repository */ + foreach($json_content as $viewName) + $this->assertTrue( is_string($viewName) ); + } + + + + } -?> \ No newline at end of file +?> diff --git a/receiver.php b/receiver.php index 8a63dd9..34df0d1 100644 --- a/receiver.php +++ b/receiver.php @@ -1,4 +1,4 @@ \ No newline at end of file + +?> diff --git a/view.php b/view.php index a3f06ba..e1bf85e 100755 --- a/view.php +++ b/view.php @@ -35,17 +35,17 @@ - + "; - else echo "