From 6fec924d118b5579f94a729dadbc0729a98c3577 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 21 Aug 2015 13:14:21 +0000 Subject: [PATCH] dblayerauthzgroupsTest : add the authzgroups update in the tests git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2273 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- Tests/dblayerauthzgroupsTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Tests/dblayerauthzgroupsTest.php b/Tests/dblayerauthzgroupsTest.php index 02b12af..5bc7193 100644 --- a/Tests/dblayerauthzgroupsTest.php +++ b/Tests/dblayerauthzgroupsTest.php @@ -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 () {