diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php
index e2d4567..bdac929 100755
--- a/phpunit/bootstrap.php
+++ b/phpunit/bootstrap.php
@@ -1,7 +1,7 @@
0.00% |
0 / 1 |
-
-
- 14.29% covered (danger)
-
-
- |
- 14.29% |
- 1 / 7 |
- CRAP |
-
- 62.20% covered (warning)
+
+ 57.14% covered (warning)
|
- 62.20% |
- 51 / 82 |
+ 57.14% |
+ 4 / 7 |
+ CRAP |
+
+
+ 84.15% covered (warning)
+
+
+ |
+ 84.15% |
+ 69 / 82 |
@@ -79,23 +79,23 @@
0.00% |
0 / 1 |
-
-
- 14.29% covered (danger)
-
-
- |
- 14.29% |
- 1 / 7 |
- 172.49 |
-
- 62.20% covered (warning)
+
+ 57.14% covered (warning)
|
- 62.20% |
- 51 / 82 |
+ 57.14% |
+ 4 / 7 |
+ 57.18 |
+
+
+ 84.15% covered (warning)
+
+
+ |
+ 84.15% |
+ 69 / 82 |
@@ -108,15 +108,15 @@
0.00% |
0 / 1 |
- 2.15 |
+ 2.01 |
-
- 66.67% covered (warning)
+
+ 88.89% covered (warning)
|
- 66.67% |
- 6 / 9 |
+ 88.89% |
+ 8 / 9 |
@@ -129,57 +129,57 @@
0.00% |
0 / 1 |
- 6.84 |
+ 6.10 |
-
- 71.43% covered (warning)
+
+ 85.71% covered (warning)
|
- 71.43% |
- 5 / 7 |
+ 85.71% |
+ 6 / 7 |
- getPDO |
-
-
- 0.00% covered (danger)
+ getPDO |
+
+
+ 100.00% covered (success)
|
- 0.00% |
- 0 / 1 |
- 1.12 |
-
-
- 50.00% covered (danger)
+ 100.00% |
+ 1 / 1 |
+ 1 |
+
+
+ 100.00% covered (success)
|
- 50.00% |
- 1 / 2 |
+ 100.00% |
+ 2 / 2 |
| |
- getConfig |
-
-
- 0.00% covered (danger)
+ getConfig |
+
+
+ 100.00% covered (success)
|
- 0.00% |
- 0 / 1 |
- 2 |
-
-
- 0.00% covered (danger)
+ 100.00% |
+ 1 / 1 |
+ 1 |
+
+
+ 100.00% covered (success)
|
- 0.00% |
- 0 / 3 |
+ 100.00% |
+ 3 / 3 |
| |
@@ -204,24 +204,24 @@
- check |
-
-
- 0.00% covered (danger)
+ check |
+
+
+ 100.00% covered (success)
|
- 0.00% |
- 0 / 1 |
- 68.06 |
-
-
- 56.00% covered (warning)
+ 100.00% |
+ 1 / 1 |
+ 23 |
+
+
+ 100.00% covered (success)
|
- 56.00% |
- 14 / 25 |
+ 100.00% |
+ 25 / 25 |
| |
@@ -277,47 +277,47 @@
| |
| |
| public function __construct($host, $dbname, $username, $password){ |
- | $this->host = $host; |
- | $this->dbname = $dbname; |
- | $this->username = $username; |
- | $this->password = $password; |
+ | $this->host = $host; |
+ | $this->dbname = $dbname; |
+ | $this->username = $username; |
+ | $this->password = $password; |
| |
| try{ |
- | self::$pdo = new \PDO('mysql:host='.$this->host.';dbname='.$this->dbname, $this->username, $this->password); |
+ | self::$pdo = new \PDO('mysql:host='.$this->host.';dbname='.$this->dbname, $this->username, $this->password); |
| |
| |
- | self::$error = ManagerError::Success; |
+ | self::$error = ManagerError::Success; |
| |
- | }catch(Exception $e){ |
+ | }catch(Exception $e){ |
| |
| self::$error = ManagerError::PDOConnection; |
| } |
- | } |
+ | } |
| |
| |
| |
| public static function getInstance(){ |
- | if( self::$instance == null || self::$error != ManagerError::Success ){ |
+ | if( self::$instance == null || self::$error != ManagerError::Success ){ |
| |
| |
- | if( !isset($_SERVER['HTTP_HOST']) || isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'socioview' ) |
- | $conf = json_decode( ResourceDispatcher::getResource(self::$config_path['local']), true ); |
+ | if( !isset($_SERVER['HTTP_HOST']) || isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'socioview' ) |
+ | $conf = json_decode( ResourceDispatcher::getResource(self::$config_path['local']), true ); |
| else |
- | $conf = json_decode( ResourceDispatcher::getResource(self::$config_path['remote']), true ); |
+ | $conf = json_decode( ResourceDispatcher::getResource(self::$config_path['remote']), true ); |
| |
| |
- | self::$instance = new DataBase($conf['host'], $conf['dbname'], $conf['user'], $conf['password']); |
+ | self::$instance = new DataBase($conf['host'], $conf['dbname'], $conf['user'], $conf['password']); |
| |
- | } |
+ | } |
| |
- | return self::$instance; |
+ | return self::$instance; |
| } |
| |
| |
| public static function getPDO(){ |
- | $instance = self::getInstance(); |
+ | $instance = self::getInstance(); |
| |
- | return self::$pdo; |
+ | return self::$pdo; |
| } |
| |
| |
@@ -330,9 +330,9 @@
| |
| public function getConfig(){ |
| return array( |
- | 'host' => $this->host, |
- | 'username' => $this->username |
- | ); |
+ | 'host' => $this->host, |
+ | 'username' => $this->username |
+ | ); |
| } |
| |
| |
@@ -435,44 +435,44 @@
| |
| |
| public static function check($type, $value){ |
- | $checker = true; |
+ | $checker = true; |
| |
| |
| |
- | if( is_null($value) ) return false; |
+ | if( is_null($value) ) return false; |
| |
| |
| |
| |
| |
- | if( preg_match('/^varchar\((\d+), ?(\d+)\)$/', $type, $match) ){ |
+ | if( preg_match('/^varchar\((\d+), ?(\d+)\)$/', $type, $match) ){ |
| |
- | $min = (int) $match[1]; |
+ | $min = (int) $match[1]; |
| |
- | $max = (int) $match[2]; |
+ | $max = (int) $match[2]; |
| |
| |
- | return $checker && is_string($value) && strlen($value) <= $max && strlen($value) >= $min; |
+ | return $checker && is_string($value) && strlen($value) <= $max && strlen($value) >= $min; |
| } |
| |
| |
| |
| |
- | if( preg_match('/^array<(.+)>$/', $type, $match) ){ |
+ | if( preg_match('/^array<(.+)>$/', $type, $match) ){ |
| |
- | if( !is_array($value) ) |
- | return false; |
+ | if( !is_array($value) ) |
+ | return false; |
| |
- | $elements_type = $match[1]; |
+ | $elements_type = $match[1]; |
| |
| |
- | foreach($value as $element) |
+ | foreach($value as $element) |
| |
- | if( !self::check($elements_type, $element) ) |
- | return false; |
+ | if( !self::check($elements_type, $element) ) |
+ | return false; |
| |
| |
- | return true; |
+ | return true; |
| } |
| |
| |
@@ -480,28 +480,28 @@
| |
| switch($type){ |
| |
- | case 'id': |
+ | case 'id': |
| return $checker && is_numeric($value) && $value <= 2147483647 && $value >= 0; |
| break; |
| |
| |
- | case 'text': |
- | return $checker && is_string($value); |
+ | case 'text': |
+ | return $checker && is_string($value); |
| |
| |
- | case 'mail': |
+ | case 'mail': |
| return $checker && is_string($value) && strlen($value) <= 50 && preg_match('/^[\w\.-]+@[\w\.-]+\.[a-z]{2,4}$/i', $value); |
| break; |
| |
| |
- | case 'sha1': |
+ | case 'sha1': |
| return $checker && is_string($value) && preg_match('/^[\da-f]{40}$/i', $value); |
| break; |
| |
- | default: |
- | return false; |
+ | default: |
+ | return false; |
| |
- | } |
+ | } |
| |
| return $checker; |
| |
@@ -559,7 +559,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 10:22:22 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 10:48:24 UTC 2016.
diff --git a/phpunit/coverage/ManagerError.php.html b/phpunit/coverage/ManagerError.php.html
index c81b112..60b50b6 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 10:22:22 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 10:48:24 UTC 2016.
diff --git a/phpunit/coverage/ResourceDispatcher.php.html b/phpunit/coverage/ResourceDispatcher.php.html
index 2a0dd9e..6289f3c 100755
--- a/phpunit/coverage/ResourceDispatcher.php.html
+++ b/phpunit/coverage/ResourceDispatcher.php.html
@@ -262,49 +262,49 @@
| |
| |
| public function __construct($url, $view=false){ |
- | $this->error = ManagerError::Success; |
+ | $this->error = ManagerError::Success; |
| |
| |
| |
| |
| |
- | $extensions_conf = json_decode( file_get_contents(__ROOT__.self::$extension_config_path), true ); |
+ | $extensions_conf = json_decode( file_get_contents(__ROOT__.self::$extension_config_path), true ); |
| |
| |
- | if( $extensions_conf == null ){ |
+ | if( $extensions_conf == null ){ |
| $this->error = ManagerError::ParsingFailed; |
| return false; |
| } |
| |
- | self::$supported_extensions = $extensions_conf; |
+ | self::$supported_extensions = $extensions_conf; |
| |
| |
- | $parents_conf = json_decode( file_get_contents(__ROOT__.self::$parents_config_path), true ); |
+ | $parents_conf = json_decode( file_get_contents(__ROOT__.self::$parents_config_path), true ); |
| |
| |
- | if( $parents_conf == null ){ |
+ | if( $parents_conf == null ){ |
| $this->error = ManagerError::ParsingFailed; |
| return false; |
| } |
| |
- | self::$supported_parents = $parents_conf; |
+ | self::$supported_parents = $parents_conf; |
| |
| |
| |
| |
| |
- | $serialFlags = array_slice( explode('/',$url), 1 ); |
+ | $serialFlags = array_slice( explode('/',$url), 1 ); |
| |
| |
| |
- | if( !$this->createFlags($serialFlags) ){ |
+ | if( !$this->createFlags($serialFlags) ){ |
| $this->error = ManagerError::InvalidFlags; |
| return false; |
| } |
| |
| |
| |
- | if( !$this->buildPath() ){ |
+ | if( !$this->buildPath() ){ |
| $this->error = ManagerError::UnreachableResource; |
| return false; |
| } |
@@ -312,10 +312,10 @@
| |
| |
| if( $view ) |
- | $this->view(); |
+ | $this->view(); |
| |
| |
- | return true; |
+ | return true; |
| |
| } |
| |
@@ -328,8 +328,8 @@
| |
| |
| public static function getResource($route){ |
- | $instance = new ResourceDispatcher($route); |
- | return $instance->getContent(); |
+ | $instance = new ResourceDispatcher($route); |
+ | return $instance->getContent(); |
| } |
| |
| |
@@ -345,51 +345,51 @@
| |
| |
| |
- | $correct = true; |
+ | $correct = true; |
| |
| |
- | $correct = $correct && count($serialFlags) >= 3; |
+ | $correct = $correct && count($serialFlags) >= 3; |
| |
| |
- | $correct = $correct && array_key_exists($serialFlags[0], self::$supported_extensions); |
+ | $correct = $correct && array_key_exists($serialFlags[0], self::$supported_extensions); |
| |
| |
- | $correct = $correct && preg_match('/^[\w_\.-]+$/i', $serialFlags[1]); |
+ | $correct = $correct && preg_match('/^[\w_\.-]+$/i', $serialFlags[1]); |
| |
| |
- | $correct = $correct && array_key_exists($serialFlags[2], self::$supported_parents); |
+ | $correct = $correct && array_key_exists($serialFlags[2], self::$supported_parents); |
| |
| |
- | $opt_subParent = count($serialFlags) >= 4; |
+ | $opt_subParent = count($serialFlags) >= 4; |
| |
| if( $opt_subParent ) |
- | $correct = $correct && preg_match('/^[\w_-]+$/i', $serialFlags[3]); |
+ | $correct = $correct && preg_match('/^[\w_-]+$/i', $serialFlags[3]); |
| |
| |
- | $opt_color = count($serialFlags) >= 5 && preg_match('/^[\da-f]{6,8}+$/i', $serialFlags[4]); |
+ | $opt_color = count($serialFlags) >= 5 && preg_match('/^[\da-f]{6,8}+$/i', $serialFlags[4]); |
| |
- | if( !$correct ) |
- | return false; |
+ | if( !$correct ) |
+ | return false; |
| |
| |
| |
| |
| |
- | $this->flags = array( |
- | 'extension' => $serialFlags[0], |
- | 'filename' => $serialFlags[1], |
- | 'parent' => $serialFlags[2] |
- | ); |
+ | $this->flags = array( |
+ | 'extension' => $serialFlags[0], |
+ | 'filename' => $serialFlags[1], |
+ | 'parent' => $serialFlags[2] |
+ | ); |
| |
| |
| if( $opt_subParent ) |
- | $this->flags['subparent'] = $serialFlags[3]; |
+ | $this->flags['subparent'] = $serialFlags[3]; |
| |
| |
| if( $opt_color ) |
- | $this->flags['color'] = '#'.$serialFlags[4]; |
+ | $this->flags['color'] = '#'.$serialFlags[4]; |
| |
- | return true; |
+ | return true; |
| |
| |
| } |
@@ -408,10 +408,10 @@
| |
| |
| |
- | if( !isset(self::$supported_extensions[$this->flags['extension']]) ) return false; |
+ | if( !isset(self::$supported_extensions[$this->flags['extension']]) ) return false; |
| |
| |
- | $header = self::$supported_extensions[$this->flags['extension']]; |
+ | $header = self::$supported_extensions[$this->flags['extension']]; |
| |
| |
| |
@@ -420,23 +420,23 @@
| |
| |
| |
- | if( !isset(self::$supported_parents[$this->flags['parent']]) ) return false; |
+ | if( !isset(self::$supported_parents[$this->flags['parent']]) ) return false; |
| |
| |
- | $parent = self::$supported_parents[$this->flags['parent']]; |
+ | $parent = self::$supported_parents[$this->flags['parent']]; |
| |
| |
| |
| |
- | $opt_subParent = (isset($this->flags['subparent'])) ? $this->flags['subparent'].'/' : ''; |
+ | $opt_subParent = (isset($this->flags['subparent'])) ? $this->flags['subparent'].'/' : ''; |
| |
| |
| |
| |
- | $this->stylesheet = ""; |
+ | $this->stylesheet = ""; |
| |
| |
- | if( isset($this->flags['color']) ){ |
+ | if( isset($this->flags['color']) ){ |
| $this->stylesheet = "\n<style type='text/css'>\n"; |
| $this->stylesheet .= "\t#stylisable{\n"; |
| $this->stylesheet .= "\t\tfill: ".$this->flags['color']." !important;\n"; |
@@ -449,15 +449,15 @@
| |
| |
| |
- | $this->header = $header; |
+ | $this->header = $header; |
| |
| |
| |
- | $this->path = __ROOT__.$parent.'/'.$opt_subParent.$this->flags['filename'].'.'.$this->flags['extension']; |
+ | $this->path = __ROOT__.$parent.'/'.$opt_subParent.$this->flags['filename'].'.'.$this->flags['extension']; |
| |
| |
| |
- | return @file_get_contents( $this->path ) != false; |
+ | return @file_get_contents( $this->path ) != false; |
| |
| } |
| |
@@ -489,15 +489,15 @@
| |
| public function getContent(){ |
| |
- | if( $this->error != ManagerError::Success ) |
- | return false; |
+ | if( $this->error != ManagerError::Success ) |
+ | return false; |
| |
| |
| |
- | $content = file_get_contents($this->path); |
+ | $content = file_get_contents($this->path); |
| |
| |
- | return str_replace( '</svg>', $this->stylesheet.'</svg>', $content ); |
+ | return str_replace( '</svg>', $this->stylesheet.'</svg>', $content ); |
| } |
| |
| |
@@ -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 10:22:22 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 10:48:24 UTC 2016.
diff --git a/phpunit/coverage/autoloader.php.html b/phpunit/coverage/autoloader.php.html
index 26e7a23..3093c19 100755
--- a/phpunit/coverage/autoloader.php.html
+++ b/phpunit/coverage/autoloader.php.html
@@ -167,19 +167,19 @@
| |
| |
| function autoloader($className){ |
- | $path = ''; |
+ | $path = ''; |
| |
| |
| |
| |
- | $path = str_replace('\\', '/', $className) . '.php'; |
- | $path = __ROOT__.'/'.$path; |
+ | $path = str_replace('\\', '/', $className) . '.php'; |
+ | $path = __ROOT__.'/'.$path; |
| |
| |
- | if( file_exists($path) ) |
- | require_once $path; |
+ | if( file_exists($path) ) |
+ | require_once $path; |
| |
- | } |
+ | } |
| |
| |
| spl_autoload_register('autoloader', false, true); |
@@ -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 10:22:22 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 10:48:24 UTC 2016.
diff --git a/phpunit/coverage/index.html b/phpunit/coverage/index.html
index 221999b..1394ca1 100755
--- a/phpunit/coverage/index.html
+++ b/phpunit/coverage/index.html
@@ -43,21 +43,21 @@
Total |
-
- 64.25% covered (warning)
+
+ 72.54% covered (warning)
|
- 64.25% |
- 124 / 193 |
+ 72.54% |
+ 140 / 193 |
-
- 38.89% covered (danger)
+
+ 50.00% covered (danger)
|
- 38.89% |
- 7 / 18 |
+ 50.00% |
+ 9 / 18 |
25.00% covered (danger)
@@ -71,21 +71,21 @@
Database.php |
-
- 62.20% covered (warning)
+
+ 84.15% covered (warning)
|
- 62.20% |
- 51 / 82 |
-
-
- 14.29% covered (danger)
+ 84.15% |
+ 69 / 82 |
+
+
+ 57.14% covered (warning)
|
- 14.29% |
- 1 / 7 |
+ 57.14% |
+ 4 / 7 |
0.00% covered (danger)
@@ -173,21 +173,21 @@
sessionManager.php |
-
- 18.75% covered (danger)
+
+ 6.25% covered (danger)
|
- 18.75% |
- 3 / 16 |
+ 6.25% |
+ 1 / 16 |
-
- 50.00% covered (danger)
+
+ 25.00% covered (danger)
|
- 50.00% |
- 2 / 4 |
+ 25.00% |
+ 1 / 4 |
diff --git a/phpunit/coverage/sessionManager.php.html b/phpunit/coverage/sessionManager.php.html
index 1eec7f2..62e6983 100755
--- a/phpunit/coverage/sessionManager.php.html
+++ b/phpunit/coverage/sessionManager.php.html
@@ -51,22 +51,22 @@
0.00% |
0 / 1 |
-
- 50.00% covered (danger)
+
+ 25.00% covered (danger)
|
- 50.00% |
- 2 / 4 |
+ 25.00% |
+ 1 / 4 |
CRAP |
-
- 18.75% covered (danger)
+
+ 6.25% covered (danger)
|
- 18.75% |
- 3 / 16 |
+ 6.25% |
+ 1 / 16 |
|
@@ -80,22 +80,22 @@
0.00% |
0 / 1 |
-
- 50.00% covered (danger)
+
+ 25.00% covered (danger)
|
- 50.00% |
- 2 / 4 |
- 75.90 |
+ 25.00% |
+ 1 / 4 |
+ 110.70 |
-
- 18.75% covered (danger)
+
+ 6.25% covered (danger)
|
- 18.75% |
- 3 / 16 |
+ 6.25% |
+ 1 / 16 |
@@ -162,24 +162,24 @@
- session_start |
-
-
- 100.00% covered (success)
+ session_start |
+
+
+ 0.00% covered (danger)
|
- 100.00% |
- 1 / 1 |
- 7 |
-
-
- 100.00% covered (success)
+ 0.00% |
+ 0 / 1 |
+ 56 |
+
+
+ 0.00% covered (danger)
|
- 100.00% |
- 2 / 2 |
+ 0.00% |
+ 0 / 2 |
| |
@@ -201,7 +201,7 @@
| |
| |
| public static function sha1($data){ |
- | return sha1( '">\[..|{@#))'.sha1($data.'_)Q@#((%*_$%(@#') ); |
+ | return sha1( '">\[..|{@#))'.sha1($data.'_)Q@#((%*_$%(@#') ); |
| } |
| |
| |
@@ -247,8 +247,8 @@
| |
| |
| public static function session_start(){ |
- | \session_start(); |
- | return; |
+ | \session_start(); |
+ | return; |
| |
| |
| |
@@ -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 10:22:22 UTC 2016.
+ Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Sun Apr 17 10:48:24 UTC 2016.
diff --git a/phpunit/phpunit.xml b/phpunit/phpunit.xml
index 2c2d7f8..c551a1b 100755
--- a/phpunit/phpunit.xml
+++ b/phpunit/phpunit.xml
@@ -10,9 +10,9 @@
./tests/ManagerError.php
-
+
diff --git a/phpunit/run.sh b/phpunit/run.sh
index 92fe5d4..29714f9 100644
--- a/phpunit/run.sh
+++ b/phpunit/run.sh
@@ -1 +1 @@
-phpunit -c phpunit.xml --bootstrap bootstrap.php --coverage-html coverage
\ No newline at end of file
+phpunit -c phpunit.xml
diff --git a/phpunit/tests/Database_check.php b/phpunit/tests/Database_check.php
index b4a176c..a965f50 100755
--- a/phpunit/tests/Database_check.php
+++ b/phpunit/tests/Database_check.php
@@ -92,8 +92,49 @@
/* [3] Test des tableaux avec type des elements
=========================================================*/
-
+ /* (1) Type */
+ public function testArrayTypeCorrect(){
+ $this->assertTrue( \manager\Database::check('array', array() ) );
+ }
+ public function testArrayTypeIncorrect(){
+ $this->assertFalse( \manager\Database::check('array', 10 ) );
+ $this->assertFalse( \manager\Database::check('array', 'string' ) );
+ }
+ /* (2) Tests divers */
+ public function testArrayEmpty(){
+ $arr = array();
+
+ $this->assertTrue( \manager\Database::check("array", $arr) );
+ }
+ public function testArrayNotEmpty(){
+ $arr = array('a', 'b');
+
+ $this->assertTrue( \manager\Database::check("array", $arr) );
+ }
+
+ public function testArrayAllRight(){
+ $arr = array('a', 'aa', 'a', 'bb');
+
+ $this->assertTrue( \manager\Database::check("array", $arr) );
+ }
+ public function testArrayOneWrong(){
+ $arr = array('a', 'aa', 'a', 'bb', 'aaa');
+
+ $this->assertFalse( \manager\Database::check("array", $arr) );
+ }
+
+
+ public function testArrayRecursive(){
+ $arr = array(
+ array(1, 100),
+ array(1, 100),
+ array(1, 100),
+ array(1, 100)
+ );
+
+ $this->assertFalse( \manager\Database::check("array>", $arr) );
+ }
diff --git a/phpunit/tests/Database_construct.php b/phpunit/tests/Database_construct.php
index 8a1ee18..65693a5 100755
--- a/phpunit/tests/Database_construct.php
+++ b/phpunit/tests/Database_construct.php
@@ -50,7 +50,7 @@
public function testPDO(){
$pdo = \manager\Database::getPDO();
- $this->assertGreaterThan( 10, count($pdo->query('SELECT * FROM user')->fetchAll()), '[!] Moins de 10 utilisateurs trouves.');
+ $this->assertGreaterThan( 0, count($pdo->query('SELECT * FROM users')->fetchAll()), '[!] Aucun utilisateur trouve.');
}
| | |