From 59e38dff4ef9de1f7d2e3c95a4341b2bba798f84 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 23 Sep 2016 14:46:24 +0000 Subject: [PATCH] Remove all the trailing spaces git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3076 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- Tests/authhtpasswdTest.php | 10 ++++----- Tests/authzgroupsTest.php | 38 ++++++++++++++++---------------- Tests/dbjsonTest.php | 14 ++++++------ Tests/dblayerComplet.php | 4 ++-- Tests/dblayerauthzgroupsTest.php | 20 ++++++++--------- Tests/outputhtmlTest.php | 2 +- Tests/userssqlTest.php | 2 +- outputjson.php | 2 +- tools/dbjsonDecode.php | 1 - 9 files changed, 46 insertions(+), 47 deletions(-) diff --git a/Tests/authhtpasswdTest.php b/Tests/authhtpasswdTest.php index dab90c3..6561c04 100644 --- a/Tests/authhtpasswdTest.php +++ b/Tests/authhtpasswdTest.php @@ -9,7 +9,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase public function test_clean () { @unlink ("/tmp/htpasswd.file"); - file_put_contents ("/tmp/htpasswd.file", + file_put_contents ("/tmp/htpasswd.file", 'toto@toto.com:$2y$05$dO7qyX4simzg3pMgWyqHgeAjFauXEyUdPdyrwDMVNj4fTuE24TGuq' ."\n". 'titi@titi.com:$2y$05$dO7qyX4simzg3pMgWyqHgeAjFauXEyUdPdyrwDMVNj4fTuE24TGuq' @@ -29,7 +29,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase { $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; - $res = $authhtpasswd->authentication ("toto@toto.com", "toto123"); + $res = $authhtpasswd->authentication ("toto@toto.com", "toto123"); $this->assertSame ($res, true); } @@ -38,7 +38,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; $this->setExpectedException ("Exception"); - $res = $authhtpasswd->authentication ("UNKNOWN@toto.com", "toto123"); + $res = $authhtpasswd->authentication ("UNKNOWN@toto.com", "toto123"); } public function test_authentication3 () @@ -46,14 +46,14 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; $this->setExpectedException ("Exception"); - $res = $authhtpasswd->authentication ("toto@toto.com", "BAD PASSWD"); + $res = $authhtpasswd->authentication ("toto@toto.com", "BAD PASSWD"); } public function test_authentication4 () { $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; - $res = $authhtpasswd->authentication ("titi@titi.com", "toto123"); + $res = $authhtpasswd->authentication ("titi@titi.com", "toto123"); $this->assertSame ($res, true); } } diff --git a/Tests/authzgroupsTest.php b/Tests/authzgroupsTest.php index fc0a1d4..7fdc1aa 100644 --- a/Tests/authzgroupsTest.php +++ b/Tests/authzgroupsTest.php @@ -39,7 +39,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_createTables2 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->createTables (); @@ -52,7 +52,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_objectCreate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->objectAdd ("MODULE", "/object"); @@ -62,7 +62,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_objectUpdate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->objectUpdate ("MODULE", "/object", "/object2"); @@ -72,7 +72,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_objectDelete1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); // The object was renamed and is not available @@ -86,7 +86,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_groupCreate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->groupAdd ("MODULE", "group"); @@ -96,7 +96,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_groupUpdate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->groupUpdate ("MODULE", "group", "group2"); @@ -106,7 +106,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_groupDelete1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); // The group doesn't exists @@ -120,7 +120,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_groupmemberCreate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); // The group doesn't exists @@ -131,7 +131,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_groupmemberCreate2 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->groupmemberAdd ("MODULE", "group2", "userKnown"); @@ -141,7 +141,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_groupmemberDelete1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); // The group doesn't exists @@ -158,7 +158,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase // The group doesn't exists $this->setExpectedException ("Exception"); $res = $authz->groupmemberReadGroup ("MODULE", "group"); - } + } public function test_groupmemberReadGroup2 () { @@ -168,7 +168,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase $this->dbconfig["driver_options"]); $res = $authz->groupmemberReadGroup ("MODULE", "group2"); $this->assertSame (array (array ("user"=>"userKnown")), $res); - } + } public function test_groupmemberReadUser1 () { @@ -178,7 +178,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase $this->dbconfig["driver_options"]); $res = $authz->groupmemberReadUser ("MODULE", "userKnown"); $this->assertSame (array (1=>"group2"), $res); - } + } //////////////// // RIGHTS // @@ -186,7 +186,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_rightCreate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->rightAdd ("MODULE", "group2","/object2", "RW"); @@ -196,7 +196,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_rightUpdate1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->rightUpdate ("MODULE", "group2", "/object2", "RO"); @@ -206,7 +206,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_rightDelete1 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); // The object doesn't exists @@ -221,7 +221,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_deleteGroupmember2 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->groupmemberDel ("MODULE", "group2","userKnown"); @@ -231,7 +231,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_deleteObject2 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->objectDel ("MODULE", "/object2"); @@ -241,7 +241,7 @@ class test_authzgroups extends PHPUnit_Framework_TestCase public function test_deleteGroup2 () { $authz = new authzgroups (); - $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], + $authz->connect ($this->dbconfig["dsn"], $this->dbconfig["username"], $this->dbconfig["password"], $this->dbconfig["driver_options"]); $res = $authz->groupDel ("MODULE", "group2"); diff --git a/Tests/dbjsonTest.php b/Tests/dbjsonTest.php index 2829f14..5343a98 100644 --- a/Tests/dbjsonTest.php +++ b/Tests/dbjsonTest.php @@ -32,7 +32,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase $res = $dbjson->insertMany ("collection", array ("key1"=>"val1", "key2"=>"val2")); } - + public function test_insertMany2 () { // Document #2 and #3 @@ -42,7 +42,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase array ("key1"=>"val3", "key2"=>"val4"))); $this->assertSame ($res, 2); } - + public function test_filter1 () { // Return all the keys (filter = array ()) @@ -118,7 +118,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase } public function test_find3 () { - // Exception : fields not an array + // Exception : fields not an array $this->setExpectedException ("Exception"); $dbjson = new dbjson ("dbjson://".dbfile); $res = $dbjson->find ("collection", array ("key1"=>array ("val3", "<="), @@ -234,7 +234,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase unset ($res[2]["_id"]); $this->assertSame ($res, array ()); } - + public function test_find11 () { $dbjson = new dbjson ("dbjson://".dbfile); @@ -262,7 +262,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase public function test_update1 () { $dbjson = new dbjson ("dbjson://".dbfile); - $res = $dbjson->update ("collection", array (), array ("key2"=>"val6", + $res = $dbjson->update ("collection", array (), array ("key2"=>"val6", "key5"=>"val5")); $this->assertSame ($res, 1); } @@ -299,7 +299,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase public function test_update2 () { $dbjson = new dbjson ("dbjson://".dbfile); - $res = $dbjson->update ("collection", array (), array ("key2"=>"val7", + $res = $dbjson->update ("collection", array (), array ("key2"=>"val7", "key5"=>"val8")); $this->assertSame ($res, 2); } @@ -321,7 +321,7 @@ class test_dbjson extends PHPUnit_Framework_TestCase { $dbjson = new dbjson ("dbjson://".dbfile); $res = $dbjson->update ("collection", array (), - array ("key2"=>"val9", + array ("key2"=>"val9", "key5"=>"val7", "_unset"=>array ("key2"))); $this->assertSame ($res, 2); diff --git a/Tests/dblayerComplet.php b/Tests/dblayerComplet.php index 2bb00ad..2b175b8 100644 --- a/Tests/dblayerComplet.php +++ b/Tests/dblayerComplet.php @@ -45,7 +45,7 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase $table) { $db->table = $table; - try + try { $res = $db->dropTable(); } @@ -270,7 +270,7 @@ class test_dblayer_{ENGINE} extends PHPUnit_Framework_TestCase // SQLite start at 1, MySQL start at 0... $this->assertLessThanOrEqual ($res, 2); } - + // Test the unique feature public function test_insert3 () { diff --git a/Tests/dblayerauthzgroupsTest.php b/Tests/dblayerauthzgroupsTest.php index 42c9916..5b05b14 100644 --- a/Tests/dblayerauthzgroupsTest.php +++ b/Tests/dblayerauthzgroupsTest.php @@ -88,7 +88,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $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"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $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"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $res = count ($n->read ()); @@ -209,7 +209,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $res = count ($n->read ()); @@ -240,7 +240,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $this->setExpectedException ("Exception"); @@ -282,7 +282,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $this->setExpectedException ("Exception"); @@ -312,7 +312,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $this->setExpectedException ("Exception"); @@ -354,7 +354,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $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"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $res = $n->delete (1); @@ -426,7 +426,7 @@ class test_dblayerauthzgroups_sqlite extends PHPUnit_Framework_TestCase ->uniqueSet (array ("id", array ("zo ne", "vie wname"))) ->authzgroupsSet ($a) ->moduleSet ("modTest") - ->userSet ("user") + ->userSet ("user") ->createGroupSet ("group") ->pathSet ("/article/base/poub"); $res = $n->read (null, array ("zo ne", "vie wname")); diff --git a/Tests/outputhtmlTest.php b/Tests/outputhtmlTest.php index 8d77764..46d9e57 100644 --- a/Tests/outputhtmlTest.php +++ b/Tests/outputhtmlTest.php @@ -33,7 +33,7 @@ class test_outputhtml extends PHPUnit_Framework_TestCase $this->expectOutputString(" Text - +"." "." \n"); $output = new outputhtml (); $output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" ); diff --git a/Tests/userssqlTest.php b/Tests/userssqlTest.php index f258c8c..4da7fe9 100644 --- a/Tests/userssqlTest.php +++ b/Tests/userssqlTest.php @@ -90,7 +90,7 @@ class test_userssql extends PHPUnit_Framework_TestCase "titi2"); $this->assertSame ($res, 1); } - + public function test_listusers3 () { $userssql = new userssql ("sqlite:///tmp/database.db"); diff --git a/outputjson.php b/outputjson.php index 48871f7..582bb02 100644 --- a/outputjson.php +++ b/outputjson.php @@ -4,7 +4,7 @@ @author Dominique Fournier */ require_once ("output.php"); -/** Display in JSON the data provided +/** Display in JSON the data provided * The data must NOT be binary ! */ class outputjson extends output diff --git a/tools/dbjsonDecode.php b/tools/dbjsonDecode.php index 06ff956..4ba921b 100755 --- a/tools/dbjsonDecode.php +++ b/tools/dbjsonDecode.php @@ -12,4 +12,3 @@ if (! is_writeable ($file)) die ("File $file not writeable\n"); print_r (json_decode (file_get_contents ($file))); -