Remove all the trailing spaces
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3076 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -9,7 +9,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase
|
|||||||
public function test_clean ()
|
public function test_clean ()
|
||||||
{
|
{
|
||||||
@unlink ("/tmp/htpasswd.file");
|
@unlink ("/tmp/htpasswd.file");
|
||||||
file_put_contents ("/tmp/htpasswd.file",
|
file_put_contents ("/tmp/htpasswd.file",
|
||||||
'toto@toto.com:$2y$05$dO7qyX4simzg3pMgWyqHgeAjFauXEyUdPdyrwDMVNj4fTuE24TGuq'
|
'toto@toto.com:$2y$05$dO7qyX4simzg3pMgWyqHgeAjFauXEyUdPdyrwDMVNj4fTuE24TGuq'
|
||||||
."\n".
|
."\n".
|
||||||
'titi@titi.com:$2y$05$dO7qyX4simzg3pMgWyqHgeAjFauXEyUdPdyrwDMVNj4fTuE24TGuq'
|
'titi@titi.com:$2y$05$dO7qyX4simzg3pMgWyqHgeAjFauXEyUdPdyrwDMVNj4fTuE24TGuq'
|
||||||
@@ -29,7 +29,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$authhtpasswd = new authhtpasswd ();
|
$authhtpasswd = new authhtpasswd ();
|
||||||
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
||||||
$res = $authhtpasswd->authentication ("toto@toto.com", "toto123");
|
$res = $authhtpasswd->authentication ("toto@toto.com", "toto123");
|
||||||
$this->assertSame ($res, true);
|
$this->assertSame ($res, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase
|
|||||||
$authhtpasswd = new authhtpasswd ();
|
$authhtpasswd = new authhtpasswd ();
|
||||||
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
$res = $authhtpasswd->authentication ("UNKNOWN@toto.com", "toto123");
|
$res = $authhtpasswd->authentication ("UNKNOWN@toto.com", "toto123");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_authentication3 ()
|
public function test_authentication3 ()
|
||||||
@@ -46,14 +46,14 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase
|
|||||||
$authhtpasswd = new authhtpasswd ();
|
$authhtpasswd = new authhtpasswd ();
|
||||||
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
$res = $authhtpasswd->authentication ("toto@toto.com", "BAD PASSWD");
|
$res = $authhtpasswd->authentication ("toto@toto.com", "BAD PASSWD");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_authentication4 ()
|
public function test_authentication4 ()
|
||||||
{
|
{
|
||||||
$authhtpasswd = new authhtpasswd ();
|
$authhtpasswd = new authhtpasswd ();
|
||||||
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
$authhtpasswd->htpasswdFile = "/tmp/htpasswd.file";
|
||||||
$res = $authhtpasswd->authentication ("titi@titi.com", "toto123");
|
$res = $authhtpasswd->authentication ("titi@titi.com", "toto123");
|
||||||
$this->assertSame ($res, true);
|
$this->assertSame ($res, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_createTables2 ()
|
public function test_createTables2 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->createTables ();
|
$res = $authz->createTables ();
|
||||||
@@ -52,7 +52,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_objectCreate1 ()
|
public function test_objectCreate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->objectAdd ("MODULE", "/object");
|
$res = $authz->objectAdd ("MODULE", "/object");
|
||||||
@@ -62,7 +62,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_objectUpdate1 ()
|
public function test_objectUpdate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->objectUpdate ("MODULE", "/object", "/object2");
|
$res = $authz->objectUpdate ("MODULE", "/object", "/object2");
|
||||||
@@ -72,7 +72,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_objectDelete1 ()
|
public function test_objectDelete1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
// The object was renamed and is not available
|
// The object was renamed and is not available
|
||||||
@@ -86,7 +86,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_groupCreate1 ()
|
public function test_groupCreate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupAdd ("MODULE", "group");
|
$res = $authz->groupAdd ("MODULE", "group");
|
||||||
@@ -96,7 +96,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_groupUpdate1 ()
|
public function test_groupUpdate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupUpdate ("MODULE", "group", "group2");
|
$res = $authz->groupUpdate ("MODULE", "group", "group2");
|
||||||
@@ -106,7 +106,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_groupDelete1 ()
|
public function test_groupDelete1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
// The group doesn't exists
|
// The group doesn't exists
|
||||||
@@ -120,7 +120,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_groupmemberCreate1 ()
|
public function test_groupmemberCreate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
// The group doesn't exists
|
// The group doesn't exists
|
||||||
@@ -131,7 +131,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_groupmemberCreate2 ()
|
public function test_groupmemberCreate2 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupmemberAdd ("MODULE", "group2", "userKnown");
|
$res = $authz->groupmemberAdd ("MODULE", "group2", "userKnown");
|
||||||
@@ -141,7 +141,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_groupmemberDelete1 ()
|
public function test_groupmemberDelete1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
// The group doesn't exists
|
// The group doesn't exists
|
||||||
@@ -158,7 +158,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
// The group doesn't exists
|
// The group doesn't exists
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
$res = $authz->groupmemberReadGroup ("MODULE", "group");
|
$res = $authz->groupmemberReadGroup ("MODULE", "group");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_groupmemberReadGroup2 ()
|
public function test_groupmemberReadGroup2 ()
|
||||||
{
|
{
|
||||||
@@ -168,7 +168,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupmemberReadGroup ("MODULE", "group2");
|
$res = $authz->groupmemberReadGroup ("MODULE", "group2");
|
||||||
$this->assertSame (array (array ("user"=>"userKnown")), $res);
|
$this->assertSame (array (array ("user"=>"userKnown")), $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_groupmemberReadUser1 ()
|
public function test_groupmemberReadUser1 ()
|
||||||
{
|
{
|
||||||
@@ -178,7 +178,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupmemberReadUser ("MODULE", "userKnown");
|
$res = $authz->groupmemberReadUser ("MODULE", "userKnown");
|
||||||
$this->assertSame (array (1=>"group2"), $res);
|
$this->assertSame (array (1=>"group2"), $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
// RIGHTS //
|
// RIGHTS //
|
||||||
@@ -186,7 +186,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_rightCreate1 ()
|
public function test_rightCreate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->rightAdd ("MODULE", "group2","/object2", "RW");
|
$res = $authz->rightAdd ("MODULE", "group2","/object2", "RW");
|
||||||
@@ -196,7 +196,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_rightUpdate1 ()
|
public function test_rightUpdate1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->rightUpdate ("MODULE", "group2", "/object2", "RO");
|
$res = $authz->rightUpdate ("MODULE", "group2", "/object2", "RO");
|
||||||
@@ -206,7 +206,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_rightDelete1 ()
|
public function test_rightDelete1 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
// The object doesn't exists
|
// The object doesn't exists
|
||||||
@@ -221,7 +221,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_deleteGroupmember2 ()
|
public function test_deleteGroupmember2 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupmemberDel ("MODULE", "group2","userKnown");
|
$res = $authz->groupmemberDel ("MODULE", "group2","userKnown");
|
||||||
@@ -231,7 +231,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_deleteObject2 ()
|
public function test_deleteObject2 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->objectDel ("MODULE", "/object2");
|
$res = $authz->objectDel ("MODULE", "/object2");
|
||||||
@@ -241,7 +241,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase
|
|||||||
public function test_deleteGroup2 ()
|
public function test_deleteGroup2 ()
|
||||||
{
|
{
|
||||||
$authz = new authzgroups ();
|
$authz = new authzgroups ();
|
||||||
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
$authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"],
|
||||||
$this->dbconfig["password"],
|
$this->dbconfig["password"],
|
||||||
$this->dbconfig["driver_options"]);
|
$this->dbconfig["driver_options"]);
|
||||||
$res = $authz->groupDel ("MODULE", "group2");
|
$res = $authz->groupDel ("MODULE", "group2");
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
$res = $dbjson->insertMany ("collection",
|
$res = $dbjson->insertMany ("collection",
|
||||||
array ("key1"=>"val1", "key2"=>"val2"));
|
array ("key1"=>"val1", "key2"=>"val2"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_insertMany2 ()
|
public function test_insertMany2 ()
|
||||||
{
|
{
|
||||||
// Document #2 and #3
|
// Document #2 and #3
|
||||||
@@ -42,7 +42,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
array ("key1"=>"val3", "key2"=>"val4")));
|
array ("key1"=>"val3", "key2"=>"val4")));
|
||||||
$this->assertSame ($res, 2);
|
$this->assertSame ($res, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_filter1 ()
|
public function test_filter1 ()
|
||||||
{
|
{
|
||||||
// Return all the keys (filter = array ())
|
// Return all the keys (filter = array ())
|
||||||
@@ -118,7 +118,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
public function test_find3 ()
|
public function test_find3 ()
|
||||||
{
|
{
|
||||||
// Exception : fields not an array
|
// Exception : fields not an array
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
$dbjson = new dbjson ("dbjson://".dbfile);
|
$dbjson = new dbjson ("dbjson://".dbfile);
|
||||||
$res = $dbjson->find ("collection", array ("key1"=>array ("val3", "<="),
|
$res = $dbjson->find ("collection", array ("key1"=>array ("val3", "<="),
|
||||||
@@ -234,7 +234,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
unset ($res[2]["_id"]);
|
unset ($res[2]["_id"]);
|
||||||
$this->assertSame ($res, array ());
|
$this->assertSame ($res, array ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_find11 ()
|
public function test_find11 ()
|
||||||
{
|
{
|
||||||
$dbjson = new dbjson ("dbjson://".dbfile);
|
$dbjson = new dbjson ("dbjson://".dbfile);
|
||||||
@@ -262,7 +262,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
public function test_update1 ()
|
public function test_update1 ()
|
||||||
{
|
{
|
||||||
$dbjson = new dbjson ("dbjson://".dbfile);
|
$dbjson = new dbjson ("dbjson://".dbfile);
|
||||||
$res = $dbjson->update ("collection", array (), array ("key2"=>"val6",
|
$res = $dbjson->update ("collection", array (), array ("key2"=>"val6",
|
||||||
"key5"=>"val5"));
|
"key5"=>"val5"));
|
||||||
$this->assertSame ($res, 1);
|
$this->assertSame ($res, 1);
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
public function test_update2 ()
|
public function test_update2 ()
|
||||||
{
|
{
|
||||||
$dbjson = new dbjson ("dbjson://".dbfile);
|
$dbjson = new dbjson ("dbjson://".dbfile);
|
||||||
$res = $dbjson->update ("collection", array (), array ("key2"=>"val7",
|
$res = $dbjson->update ("collection", array (), array ("key2"=>"val7",
|
||||||
"key5"=>"val8"));
|
"key5"=>"val8"));
|
||||||
$this->assertSame ($res, 2);
|
$this->assertSame ($res, 2);
|
||||||
}
|
}
|
||||||
@@ -321,7 +321,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$dbjson = new dbjson ("dbjson://".dbfile);
|
$dbjson = new dbjson ("dbjson://".dbfile);
|
||||||
$res = $dbjson->update ("collection", array (),
|
$res = $dbjson->update ("collection", array (),
|
||||||
array ("key2"=>"val9",
|
array ("key2"=>"val9",
|
||||||
"key5"=>"val7",
|
"key5"=>"val7",
|
||||||
"_unset"=>array ("key2")));
|
"_unset"=>array ("key2")));
|
||||||
$this->assertSame ($res, 2);
|
$this->assertSame ($res, 2);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase
|
|||||||
$table)
|
$table)
|
||||||
{
|
{
|
||||||
$db->table = $table;
|
$db->table = $table;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$res = $db->dropTable();
|
$res = $db->dropTable();
|
||||||
}
|
}
|
||||||
@@ -270,7 +270,7 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase
|
|||||||
// SQLite start at 1, MySQL start at 0...
|
// SQLite start at 1, MySQL start at 0...
|
||||||
$this->assertLessThanOrEqual ($res, 2);
|
$this->assertLessThanOrEqual ($res, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the unique feature
|
// Test the unique feature
|
||||||
public function test_insert3 ()
|
public function test_insert3 ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$res = $n->insert (array ("zo ne"=>"zone1",
|
$res = $n->insert (array ("zo ne"=>"zone1",
|
||||||
@@ -130,7 +130,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$n->insert (array ("zo ne"=>"zone2", "opendate"=>"2015-05-04 00:11:22"));
|
$n->insert (array ("zo ne"=>"zone2", "opendate"=>"2015-05-04 00:11:22"));
|
||||||
@@ -165,7 +165,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$res = count ($n->read ());
|
$res = count ($n->read ());
|
||||||
@@ -209,7 +209,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$res = count ($n->read ());
|
$res = count ($n->read ());
|
||||||
@@ -240,7 +240,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
@@ -282,7 +282,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
@@ -312,7 +312,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$this->setExpectedException ("Exception");
|
$this->setExpectedException ("Exception");
|
||||||
@@ -354,7 +354,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$res = $n->update (1, array ("zo ne"=>"ALLOWED"));
|
$res = $n->update (1, array ("zo ne"=>"ALLOWED"));
|
||||||
@@ -384,7 +384,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$res = $n->delete (1);
|
$res = $n->delete (1);
|
||||||
@@ -426,7 +426,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase
|
|||||||
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
->uniqueSet (array ("id", array ("zo ne", "vie wname")))
|
||||||
->authzgroupsSet ($a)
|
->authzgroupsSet ($a)
|
||||||
->moduleSet ("modTest")
|
->moduleSet ("modTest")
|
||||||
->userSet ("user")
|
->userSet ("user")
|
||||||
->createGroupSet ("group")
|
->createGroupSet ("group")
|
||||||
->pathSet ("/article/base/poub");
|
->pathSet ("/article/base/poub");
|
||||||
$res = $n->read (null, array ("zo ne", "vie wname"));
|
$res = $n->read (null, array ("zo ne", "vie wname"));
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class test_outputhtml extends PHPUnit_Framework_TestCase
|
|||||||
$this->expectOutputString("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">
|
$this->expectOutputString("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">
|
||||||
<html><body>
|
<html><body>
|
||||||
Text
|
Text
|
||||||
|
"." "."
|
||||||
</body></html>\n");
|
</body></html>\n");
|
||||||
$output = new outputhtml ();
|
$output = new outputhtml ();
|
||||||
$output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" );
|
$output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" );
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class test_userssql extends PHPUnit_Framework_TestCase
|
|||||||
"titi2");
|
"titi2");
|
||||||
$this->assertSame ($res, 1);
|
$this->assertSame ($res, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_listusers3 ()
|
public function test_listusers3 ()
|
||||||
{
|
{
|
||||||
$userssql = new userssql ("sqlite:///tmp/database.db");
|
$userssql = new userssql ("sqlite:///tmp/database.db");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||||
|
|
||||||
require_once ("output.php");
|
require_once ("output.php");
|
||||||
/** Display in JSON the data provided
|
/** Display in JSON the data provided
|
||||||
* The data must NOT be binary !
|
* The data must NOT be binary !
|
||||||
*/
|
*/
|
||||||
class outputjson extends output
|
class outputjson extends output
|
||||||
|
|||||||
@@ -12,4 +12,3 @@ if (! is_writeable ($file))
|
|||||||
die ("File $file not writeable\n");
|
die ("File $file not writeable\n");
|
||||||
|
|
||||||
print_r (json_decode (file_get_contents ($file)));
|
print_r (json_decode (file_get_contents ($file)));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user