dblayer : test unit for UNIQUE entries
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1839 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -186,4 +186,22 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase
|
|||||||
"with space"=>"WITH SPACE")), $res);
|
"with space"=>"WITH SPACE")), $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_update3 ()
|
||||||
|
{
|
||||||
|
$dbconfig = $this->confs["{ENGINE}"];
|
||||||
|
$db = new dblayer ($dbconfig["dsn"], $dbconfig["username"],
|
||||||
|
$dbconfig["password"], $dbconfig["driver_options"]);
|
||||||
|
$db->table = "grouped";
|
||||||
|
$db->fields = array ("group"=>array ("varchar", "255", "not null"),
|
||||||
|
"object"=>array ("varchar", "255", "not null"),
|
||||||
|
"where"=>array ("varchar", "255", "not null"),
|
||||||
|
"with space"=>array ("varchar", "255", "not null"));
|
||||||
|
$db->unique = array ("group");
|
||||||
|
$db->primary = "group";
|
||||||
|
// Update primary key with primary key in unique
|
||||||
|
$res = $db->update ("NEW GROUP", array ("group"=>"NEW GROUP",
|
||||||
|
"object"=>"%éàoppp",
|
||||||
|
"with space"=>"WITH SPACE"));
|
||||||
|
$this->assertSame (1, $res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user