diff --git a/manager/autoloader.php b/manager/autoloader.php index 7e8f94e..87a2451 100755 --- a/manager/autoloader.php +++ b/manager/autoloader.php @@ -1,4 +1,7 @@ - \ No newline at end of file diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php new file mode 100644 index 0000000..e2d4567 --- /dev/null +++ b/phpunit/bootstrap.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/phpunit/coverage/Database.php.html b/phpunit/coverage/Database.php.html index f1a3610..05a6439 100755 --- a/phpunit/coverage/Database.php.html +++ b/phpunit/coverage/Database.php.html @@ -431,7 +431,7 @@ Dead Code

- Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:21:09 CET 2016. + Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:33:48 CET 2016.

diff --git a/phpunit/coverage/ManagerError.php.html b/phpunit/coverage/ManagerError.php.html index 32bc08c..57c1c12 100644 --- a/phpunit/coverage/ManagerError.php.html +++ b/phpunit/coverage/ManagerError.php.html @@ -203,7 +203,7 @@ Dead Code

- Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:21:09 CET 2016. + Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:33:48 CET 2016.

diff --git a/phpunit/coverage/ResourceDispatcher.php.html b/phpunit/coverage/ResourceDispatcher.php.html index 5cb940c..1bf9c1d 100644 --- a/phpunit/coverage/ResourceDispatcher.php.html +++ b/phpunit/coverage/ResourceDispatcher.php.html @@ -450,7 +450,7 @@ Dead Code

- Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:21:09 CET 2016. + Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:33:48 CET 2016.

diff --git a/phpunit/coverage/autoloader.php.html b/phpunit/coverage/autoloader.php.html index 1e5c090..6317d90 100755 --- a/phpunit/coverage/autoloader.php.html +++ b/phpunit/coverage/autoloader.php.html @@ -58,7 +58,7 @@ - debug() + debug()
@@ -75,7 +75,7 @@ - autoloader($className) + autoloader($className)
@@ -96,51 +96,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - + + + + + +
1
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
2
3
4
5
/* ACTIVE LE DEBUGGAGE (WARNING + EXCEPTION)
6
*
7
*/
8
function debug(){
9
ini_set('display_errors',1);
10
ini_set('display_startup_errors',1);
11
error_reporting(-1);
12
}
13
14
15
16
/* AUTOLOADER
17
*
18
* @className<String> Nom de la classe appelee
19
*
20
*/
21
function autoloader($className){
22
$path = '';
23
24
/* [1] On utilise le namespace pour localiser
25
===============================================*/
26
// On remplace les '\' par des '/'
27
$path = str_replace('\\', '/', $className) . '.php';
28
$path = __ROOT__.'/'.$path;
29
30
// Si le fichier existe, on l'inclut
31
if( file_exists($path) )
32
require_once $path;
33
}
34
35
// On definit l'autoloader comme autoloader (obvious)
36
spl_autoload_register('autoloader', false, true);
1
<?php
2
// On definit la racine __ROOT__ si c'est pas deja fait
3
if( !defined('__ROOT__') )
4
define('__ROOT__', dirname(dirname(__FILE__)) );
5
6
7
8
/* ACTIVE LE DEBUGGAGE (WARNING + EXCEPTION)
9
*
10
*/
11
function debug(){
12
ini_set('display_errors',1);
13
ini_set('display_startup_errors',1);
14
error_reporting(-1);
15
}
16
17
18
19
/* AUTOLOADER
20
*
21
* @className<String> Nom de la classe appelee
22
*
23
*/
24
function autoloader($className){
25
$path = '';
26
27
/* [1] On utilise le namespace pour localiser
28
===============================================*/
29
// On remplace les '\' par des '/'
30
$path = str_replace('\\', '/', $className) . '.php';
31
$path = __ROOT__.'/'.$path;
32
33
// Si le fichier existe, on l'inclut
34
if( file_exists($path) )
35
require_once $path;
36
}
37
38
39
38
// On definit l'autoloader comme autoloader (obvious)
39
spl_autoload_register('autoloader', false, true);
40
41
/* On demarre la session securisee PHP
42
=========================================================*/
43
// Condition ajoutee pour PHPUNIT
44
if( isset($_SERVER['REMOTE_ADDR']) )
45
\manager\sessionManager::session_start();
41
42
43
44
/* On demarre la session securisee PHP
45
=========================================================*/
46
\manager\sessionManager::session_start();
@@ -152,7 +153,7 @@ Dead Code

- Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:21:09 CET 2016. + Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:33:48 CET 2016.

diff --git a/phpunit/coverage/index.dashboard.html b/phpunit/coverage/index.dashboard.html index 4f9b37f..8951ca5 100755 --- a/phpunit/coverage/index.dashboard.html +++ b/phpunit/coverage/index.dashboard.html @@ -65,7 +65,7 @@ diff --git a/phpunit/coverage/index.html b/phpunit/coverage/index.html index d37c6b2..f01aa19 100755 --- a/phpunit/coverage/index.html +++ b/phpunit/coverage/index.html @@ -177,7 +177,7 @@ High: 70% to 100%

- Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:21:09 CET 2016. + Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:33:48 CET 2016.

diff --git a/phpunit/coverage/sessionManager.php.html b/phpunit/coverage/sessionManager.php.html index 695f607..389531d 100644 --- a/phpunit/coverage/sessionManager.php.html +++ b/phpunit/coverage/sessionManager.php.html @@ -284,7 +284,7 @@ Dead Code

- Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:21:09 CET 2016. + Generated by PHP_CodeCoverage 1.2.13 using PHP 5.5.9-1ubuntu4.14 and PHPUnit 3.7.28 at Fri Feb 12 23:33:48 CET 2016.

diff --git a/phpunit/phpunit.xml b/phpunit/phpunit.xml index 8a984d4..b316503 100755 --- a/phpunit/phpunit.xml +++ b/phpunit/phpunit.xml @@ -1,4 +1,4 @@ - + diff --git a/phpunit/tests/Database_construct.php b/phpunit/tests/Database_construct.php index 827a58f..10f0be6 100755 --- a/phpunit/tests/Database_construct.php +++ b/phpunit/tests/Database_construct.php @@ -15,7 +15,6 @@ \manager\Database::$error = \manager\ManagerError::PDOConnection; - $_SERVER['HTTP_HOST'] = 'stefproject'; $instance = \manager\Database::getInstance(); $this->assertEquals( 'localhost', $instance->getConfig()['host'] ); diff --git a/todo.md b/todo.md index 08cb501..9073064 100755 --- a/todo.md +++ b/todo.md @@ -39,6 +39,7 @@ ######## # FAIT # ######## +- [x] [autoloader][phpunit/bootstrap.php] Correction des bugs de $_SERVER avec PHPUnit -> autoloader + bootstrap personnalise - [x] [sessionManager] Import de sessionManager - [x] [phpunit/tests/Database_*] Tests unitaire de delNumeric() - [x] [Database] Mise a jour des methodes de Database