renommage de l'objet DB en Connection, suppression de la variable privée db dans le model

This commit is contained in:
Gregory Letellier
2023-11-03 08:58:42 +01:00
parent d67916e2ff
commit a6c51f5f17
4 changed files with 13 additions and 16 deletions

View File

@@ -1,18 +1,18 @@
<?php
use Kletellier\PdoWrapper\Collection;
use Kletellier\PdoWrapper\Db;
use Kletellier\PdoWrapper\Connection;
use Kletellier\PdoWrapper\EventDispatcher;
use Kletellier\PdoWrapper\Model;
use Kletellier\PdoWrapper\QueryBuilder;
test("create db",function () {
$config = ["conone" => ["TYPE"=>"sqlite", "DATABASE" => ":memory:" ], "contwo"=>["TYPE"=>"sqlite", "DATABASE" => ":memory:" ]];
$db = Db::init($config,["conone","contwo"]);
$db = Connection::init($config,["conone","contwo"]);
$ret = $db->executeRawQuery("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, col1 VARCHAR, date1 DATETIME);");
expect($ret)->toBe(true);
$db2 = Db::getInstance("contwo");
$db2 = Connection::getInstance("contwo");
$ret = $db2->executeRawQuery("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, col1 VARCHAR, date1 DATETIME);");
expect($ret)->toBe(true);
});