Correct the autoload for Unit Tests

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1652 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-08-01 12:47:21 +00:00
parent 355a8f6111
commit 086e2d1bcf

View File

@@ -4,3 +4,34 @@ spl_autoload_register(function ($class) {
@include $class . '.php';
});
define ("PHPUNIT", "ON-GOING");
define ("CONFIGFILE", "./Tests/configuration.php");
if (! file_exists (CONFIGFILE))
die ("No Config file found in ".CONFIGFILE."\n");
echo "Configuration file : ".CONFIGFILE."\n";
if (file_exists ("/tmp/database.db"))
{
unlink ("/tmp/database.db");
}
require_once ("domframework/config.php");
/** The class need to take care of configuration parameters */
class configuration extends config
{
/** All the default parameters in the configuration */
function __construct ()
{
$this->default = array (
"database"=>array ("dsn"=>null,
"username"=>null,
"password"=>null,
"driver_options"=>null,
"tableprefix"=>""),
);
if (defined("CONFIGFILE"))
$this->confFile = CONFIGFILE;
}
}
// vim: syntax=on filetype=php