Passage en Namespace et tous les tests fonctionnels OK
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
|
||||
namespace Domframework\Tests;
|
||||
|
||||
class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
use Domframework\Dblayer;
|
||||
|
||||
class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
// Test with column name 'group', 'object', 'where', 'with space'
|
||||
// Test with table name 'group', 'object', 'where', 'with space'
|
||||
@@ -42,7 +44,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_dropTable ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
foreach (array ("users", "grouped", "multiple", "multiple2", "users3",
|
||||
"readOR") as
|
||||
@@ -53,7 +55,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$res = $db->dropTable();
|
||||
}
|
||||
catch (Exception $e)
|
||||
catch (\Exception $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -67,7 +69,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
// Create a table named grouped
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -85,7 +87,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_insert1 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -105,7 +107,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_read1 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -126,7 +128,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_update1 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -144,7 +146,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_read2 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -165,7 +167,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_update2 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -184,7 +186,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_read3 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -205,7 +207,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_update3 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "grouped";
|
||||
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||
@@ -233,10 +235,10 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
// Create a table named group
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->disconnect ();
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "users";
|
||||
$db->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -254,7 +256,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_insert2 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "users";
|
||||
$db->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -279,7 +281,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_insert3 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "users";
|
||||
$db->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -302,7 +304,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_insert4 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "users";
|
||||
$db->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -329,7 +331,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
|
||||
// Create a table named group
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "multiple";
|
||||
$db->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -337,7 +339,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
"where"=>array ("varchar", "255", "not null"),
|
||||
"with space"=>array ("varchar", "255", "not null"));
|
||||
$db->createTable ();
|
||||
$db2 = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db2 = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db2->table = "multiple2";
|
||||
$db2->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -356,7 +358,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
// Create a table named group
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "users3";
|
||||
$db->fields = array ("user"=>array ("varchar", "255", "not null"),
|
||||
@@ -372,7 +374,7 @@ class dblayerTest{ENGINE} extends PHPUnit_Framework_TestCase
|
||||
public function test_readOR1 ()
|
||||
{
|
||||
$dbconfig = $this->confs["{ENGINE}"];
|
||||
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$db = new Dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||
$db->table = "readOR";
|
||||
$db->fields = array ("id"=>array ("integer"),
|
||||
|
||||
Reference in New Issue
Block a user