dblayerauthzgroupsTest : add the authzgroups update in the tests

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2273 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-08-21 13:14:21 +00:00
parent cc41170136
commit 6fec924d11

View File

@@ -97,6 +97,17 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
$this->assertSame ("1", $res);
}
// Check if the update of the authzgroups database is OK
public function test_addAuthzgroups ()
{
$dbconfig = $this->confs["sqlite"];
$a = new authzgroups ();
$a->connect ($dbconfig["dsn"], $dbconfig["username"],
$dbconfig["password"], $dbconfig["driver_options"]);
$res = $a->allow ("modTest", "user", "/article/base/poub/1");
$this->assertSame ("RW", $res);
}
public function test_insert2 ()
{
$dbconfig = $this->confs["sqlite"];
@@ -380,6 +391,18 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
$this->assertSame (1, $res);
}
// Check if the update of the authzgroups database is OK after deletion
public function test_delAuthzgroups ()
{
$dbconfig = $this->confs["sqlite"];
$a = new authzgroups ();
$a->connect ($dbconfig["dsn"], $dbconfig["username"],
$dbconfig["password"], $dbconfig["driver_options"]);
$res = $a->objectRead ("modTest", "/article/base/poub/1");
$this->assertSame (array (), $res);
}
// Read the zone without id
public function test_read3 ()
{