dblayer : add more unittests

dblayer : add compatibility in column names with MySQL and SQLite


git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1812 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-09-12 12:56:18 +00:00
parent 5e93c78ddb
commit b2264440a4
2 changed files with 20 additions and 12 deletions

View File

@@ -33,9 +33,16 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
$dbconfig["password"], $dbconfig["driver_options"]);
$db->table = "grouped";
$this->setExpectedException ("Exception");
$res = $db->dropTable();
// Never generate an error
try
{
$res = $db->dropTable();
}
catch (Exception $e)
{
}
// Never generate an error, just drop the table if it exists, and do noting
// if it doesn't exists
}
public function test_createTable ()
@@ -68,7 +75,8 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase
"object"=>"/éobj%",
"where"=>"\$'\"",
"with space"=>"with space"));
$this->assertSame ("1", $res);
// SQLite start at 1, MySQL start at 0...
$this->assertThat($res, $this->lessThanOrEqual(1));
}
public function test_read1 ()