This commit is contained in:
xdrm-brackets 2016-04-17 17:46:34 +02:00
parent 7c1989eb2d
commit 41fba4ca4a
20 changed files with 178 additions and 10 deletions

View File

@ -82,4 +82,5 @@
// )); // ));
// var_dump($response); // var_dump($response);
?> ?>

21
css/font.css Executable file
View File

@ -0,0 +1,21 @@
@font-face {
font-family: 'Proxima Nova';
font-style: normal;
font-weight: 100;
src: url("/css/fonts/proxima-nova/thin.eot");
src: url(/css/fonts/proxima-nova/thin#iefix.eot) format("embedded-opentype"),
url(/css/fonts/proxima-nova/thin.woff) format("woff"),
url(/css/fonts/proxima-nova/thin.ttf) format("truetype");
}
@font-face {
font-family: 'Proxima Nova';
font-style: normal;
font-weight: normal;
src: url("/css/fonts/proxima-nova/regular.eot");
src: url(/css/fonts/proxima-nova/regular#iefix.eot) format("embedded-opentype"),
url(/css/fonts/proxima-nova/regular.woff) format("woff"),
url(/css/fonts/proxima-nova/regular.ttf) format("truetype");
}

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -69,10 +69,17 @@
foreach($this->categories as $category){ foreach($this->categories as $category){
// On met les attributs // On met les attributs
$render .= '<span'.$this->parseAttributes($category['attributes']).'>'; $render .= '<span'.$this->parseAttributes($category['attributes']).'>';
// On met l'icone associee // On met l'icone associee
if( isset($category['icon']) )
$render .= ResourceDispatcher::getResource($category['icon']); $render .= ResourceDispatcher::getResource($category['icon']);
// On met le texte de la categorie et on ferme la balise
$render .= $category['text'].'</span>'; // On met le texte de la categorie
if( isset($category['text']) )
$render .= $category['text'];
// On ferme la balise
$render .= '</span>';
// On ouvre la liste des sous-parties // On ouvre la liste des sous-parties
@ -138,9 +145,11 @@
/* [2] Pour chaque sous-partie /* [2] Pour chaque sous-partie
=========================================================*/ =========================================================*/
if( !isset($category['children']) ) continue;
foreach($category['children'] as $b=>$children){ foreach($category['children'] as $b=>$children){
/* (1) On verifie les permissions */ /* (1) On verifie les permissions */
$canView = $this->checkPermissions($children['permissions']); $canView = $this->checkPermissions( isset($children['permissions']) ? $children['permissions'] : array() );
/* (2) Si on a l'acces, ajout au tableau */ /* (2) Si on a l'acces, ajout au tableau */
if( $canView ) if( $canView )

View File

@ -559,7 +559,7 @@
<span class="warning"><strong>Dead Code</strong></span> <span class="warning"><strong>Dead Code</strong></span>
</p> </p>
<p> <p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 10:48:24 UTC 2016.</small> <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 14:38:12 UTC 2016.</small>
</p> </p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a> <a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer> </footer>

View File

@ -247,7 +247,7 @@
<span class="warning"><strong>Dead Code</strong></span> <span class="warning"><strong>Dead Code</strong></span>
</p> </p>
<p> <p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 10:48:24 UTC 2016.</small> <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 14:38:12 UTC 2016.</small>
</p> </p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a> <a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer> </footer>

View File

@ -517,7 +517,7 @@
<span class="warning"><strong>Dead Code</strong></span> <span class="warning"><strong>Dead Code</strong></span>
</p> </p>
<p> <p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 10:48:24 UTC 2016.</small> <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 14:38:12 UTC 2016.</small>
</p> </p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a> <a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer> </footer>

View File

@ -214,7 +214,7 @@
<span class="warning"><strong>Dead Code</strong></span> <span class="warning"><strong>Dead Code</strong></span>
</p> </p>
<p> <p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 10:48:24 UTC 2016.</small> <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 14:38:12 UTC 2016.</small>
</p> </p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a> <a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer> </footer>

View File

@ -210,7 +210,7 @@
<span class="success"><strong>High</strong>: 90% to 100%</span> <span class="success"><strong>High</strong>: 90% to 100%</span>
</p> </p>
<p> <p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 10:48:24 UTC 2016.</small> <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 14:38:12 UTC 2016.</small>
</p> </p>
</footer> </footer>
</div> </div>

View File

@ -315,7 +315,7 @@
<span class="warning"><strong>Dead Code</strong></span> <span class="warning"><strong>Dead Code</strong></span>
</p> </p>
<p> <p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 10:48:24 UTC 2016.</small> <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Sun Apr 17 14:38:12 UTC 2016.</small>
</p> </p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a> <a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer> </footer>

View File

@ -10,6 +10,10 @@
<file>./tests/ManagerError.php</file> <file>./tests/ManagerError.php</file>
</testsuite> </testsuite>
<testsuite name="config/">
<file>./tests/config.php</file>
</testsuite>
<!-- <testsuite name="manager/sessionManager"> <!-- <testsuite name="manager/sessionManager">
<file>./tests/sessionManager.php</file> <file>./tests/sessionManager.php</file>
</testsuite> --> </testsuite> -->

133
phpunit/tests/config.php Normal file
View File

@ -0,0 +1,133 @@
<?php namespace phpunit;
/* VERIFICATION DES FICHIERS DE CONFIGURATION
*
*/
class config extends \PHPUnit_Framework_TestCase{
private static $config = array(
'database-local' => '../config/database-local.json',
'database' => '../config/database.json',
'dispatcher-extensions' => '../config/dispatcher-extensions.json',
'dispatcher-tree' => '../config/dispatcher-tree.json',
'menu' => '../config/menu.json',
'modules' => '../config/modules.json',
'repositories' => '../config/repositories.json',
'views' => '../config/views.json'
);
/* [1] config/database-local.json
=========================================================*/
public function testDatabaseLocal(){
/* (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);
}
/* [2] config/database.json
=========================================================*/
public function testDatabaseRemote(){
/* (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 );
/* (3) Contenu */
$this->assertArrayHasKey('host', $json_content);
$this->assertArrayHasKey('dbname', $json_content);
$this->assertArrayHasKey('user', $json_content);
$this->assertArrayHasKey('password', $json_content);
}
/* [3] config/dispatcher-extensions.json
=========================================================*/
public function testDispatcherExtensions(){
/* (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 );
/* (3) Contenu */
foreach($json_content as $ext=>$mime){
// On verifie les extensions
$this->assertTrue( preg_match('/^\w+$/i', $ext) == true );
// On verifie les mime/type
$this->assertTrue( preg_match('/^\w+\/[\+\w]+$/i', $mime) == true );
}
}
/* [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 );
/* (3) Contenu */
foreach($json_content as $name=>$path){
// On verifie les extensions
$this->assertTrue( preg_match('/^\w+$/i', $name) == true );
// On verifie les mime/type
$this->assertTrue( preg_match('/^[\w\/]+$/i', $path) == true );
}
}
/* [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 */
foreach($json_content as $category){
continue;
}
}
}
?>