renommage de l'objet DB en Connection, suppression de la variable privée db dans le model
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user