Tests are now compliant with php-cs-fixer (CamelCase for method, phpdoc valid)

This commit is contained in:
2023-04-13 22:22:46 +02:00
parent b017700d0a
commit 273db5f183
51 changed files with 3926 additions and 3637 deletions

View File

@@ -1,45 +1,74 @@
<?php
/** Autoload */
/**
* Autoload
*/
spl_autoload_register(function ($class) {
$classes = array ();
foreach (scandir ("src") as $file)
{
$fileShort = basename ($file);
if ($fileShort == "." || $fileShort == "..")
continue;
$classFile = substr ($fileShort, 0, -4);
$classes["Domframework\\".$classFile] = "src/$file";
}
if (key_exists ($class, $classes))
{
@include ($classes[$class]);
}
else
{
echo "ERROR : $class : doesnt exists in src\n";
}
$classes = [];
foreach (scandir("src") as $file) {
$fileShort = basename($file);
if ($fileShort == "." || $fileShort == "..") {
continue;
}
$classFile = substr($fileShort, 0, -4);
$classes["Domframework\\" . $classFile] = "src/$file";
}
if (key_exists($class, $classes)) {
@include($classes[$class]);
} else {
echo "ERROR : $class : doesnt exists in src\n";
}
});
define ("PHPUNIT", "ON-GOING");
define("PHPUNIT", "ON-GOING");
file_put_contents ("Tests/DblayerooSqliteTest.php",
str_replace ("{ENGINE}", "sqlite",
file_get_contents ("Tests/DblayerooComplet.php")));
file_put_contents ("Tests/DblayerooMySQLTest.php",
str_replace ("{ENGINE}", "mysql",
file_get_contents ("Tests/DblayerooComplet.php")));
file_put_contents ("Tests/DblayerooPostgreSQLTest.php",
str_replace ("{ENGINE}", "pgsql",
file_get_contents ("Tests/DblayerooComplet.php")));
file_put_contents ("Tests/DblayerSqliteTest.php",
str_replace ("{ENGINE}", "sqlite",
file_get_contents ("Tests/DblayerComplet.php")));
file_put_contents ("Tests/DblayerMySQLTest.php",
str_replace ("{ENGINE}", "mysql",
file_get_contents ("Tests/DblayerComplet.php")));
file_put_contents ("Tests/DblayerPostgreSQLTest.php",
str_replace ("{ENGINE}", "pgsql",
file_get_contents ("Tests/DblayerComplet.php")));
file_put_contents(
"Tests/DblayerooSqliteTest.php",
str_replace(
"{ENGINE}",
"sqlite",
file_get_contents("Tests/DblayerooComplet.php")
)
);
file_put_contents(
"Tests/DblayerooMySQLTest.php",
str_replace(
"{ENGINE}",
"mysql",
file_get_contents("Tests/DblayerooComplet.php")
)
);
file_put_contents(
"Tests/DblayerooPostgreSQLTest.php",
str_replace(
"{ENGINE}",
"pgsql",
file_get_contents("Tests/DblayerooComplet.php")
)
);
file_put_contents(
"Tests/DblayerSqliteTest.php",
str_replace(
"{ENGINE}",
"sqlite",
file_get_contents("Tests/DblayerComplet.php")
)
);
file_put_contents(
"Tests/DblayerMySQLTest.php",
str_replace(
"{ENGINE}",
"mysql",
file_get_contents("Tests/DblayerComplet.php")
)
);
file_put_contents(
"Tests/DblayerPostgreSQLTest.php",
str_replace(
"{ENGINE}",
"pgsql",
file_get_contents("Tests/DblayerComplet.php")
)
);
// vim: syntax=on filetype=php