Skip to content

Commit fd6c65d

Browse files
committed
Update bootstrap.php
1 parent 9e6d5fa commit fd6c65d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/bootstrap.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
require_once __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
66

7+
use webfiori\database\ConnectionInfo;
8+
use webfiori\database\migration\MigrationsRunner;
79
use webfiori\framework\App;
810
use webfiori\framework\autoload\ClassLoader;
911
use webfiori\framework\config\JsonDriver;
@@ -12,6 +14,7 @@
1214

1315
//the name of tests directory. Update as needed.
1416
define('TESTS_DIRECTORY', 'tests');
17+
define('SQL_SERVER_HOST', 'localhost');
1518
//an array that contains possible locations at which
1619
//WebFiori Framework might exist.
1720
//Add and remove directories as needed.
@@ -99,6 +102,11 @@
99102
App::getConfig()->remove();
100103
JsonDriver::setConfigFileName('super-confx.json');
101104
App::getConfig()->remove();
105+
$conn = new ConnectionInfo('mssql', 'sa', '1234567890@Eu', 'testing_db', SQL_SERVER_HOST, 1433, [
106+
'TrustServerCertificate' => 'true'
107+
]);
108+
$runner = new MigrationsRunner(APP_PATH, '', $conn);
109+
$runner->dropMigrationsTable();
102110
});
103111
fprintf(STDOUT, "Registering shutdown function completed.\n");
104112
fprintf(STDOUT,"---------------------------------\n");

0 commit comments

Comments
 (0)