diff --git a/Tests/authhtpasswdTest.php b/Tests/authhtpasswdTest.php index a45d149..dab90c3 100644 --- a/Tests/authhtpasswdTest.php +++ b/Tests/authhtpasswdTest.php @@ -22,7 +22,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; $res = $authhtpasswd->connect (); - $this->assertEquals ($res, null); + $this->assertSame ($res, null); } public function test_authentication1 () @@ -30,7 +30,7 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; $res = $authhtpasswd->authentication ("toto@toto.com", "toto123"); - $this->assertEquals ($res, true); + $this->assertSame ($res, true); } public function test_authentication2 () @@ -54,6 +54,6 @@ class test_authhtpasswd extends PHPUnit_Framework_TestCase $authhtpasswd = new authhtpasswd (); $authhtpasswd->htpasswdFile = "/tmp/htpasswd.file"; $res = $authhtpasswd->authentication ("titi@titi.com", "toto123"); - $this->assertEquals ($res, true); + $this->assertSame ($res, true); } } diff --git a/Tests/cachefileTest.php b/Tests/cachefileTest.php index 90e93a0..46d2a4e 100644 --- a/Tests/cachefileTest.php +++ b/Tests/cachefileTest.php @@ -38,7 +38,7 @@ class test_cachefile extends PHPUnit_Framework_TestCase $c = new cachefile (); $c->directory = "/tmp/cache"; $res = $c->read ("id"); - $this->assertEquals ("DATA_TO_STORE", $res); + $this->assertSame ("DATA_TO_STORE", $res); } // Sleep 3s to expire the cache @@ -77,7 +77,7 @@ class test_cachefile extends PHPUnit_Framework_TestCase $c = new cachefile (); $c->directory = "/tmp/cache"; $res = $c->read ("id"); - $this->assertEquals ("DATA_TO_STORE", $res); + $this->assertSame ("DATA_TO_STORE", $res); } public function testDel1 () diff --git a/Tests/userssqlTest.php b/Tests/userssqlTest.php index 8be8dbc..f258c8c 100644 --- a/Tests/userssqlTest.php +++ b/Tests/userssqlTest.php @@ -15,72 +15,72 @@ class test_userssql extends PHPUnit_Framework_TestCase { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->initStorage (); - $this->assertEquals ($res, 0); + $this->assertSame ($res, 0); } public function test_listusers1 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->listusers (); - $this->assertEquals ($res, array ()); + $this->assertSame ($res, array ()); } public function test_adduser1 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->adduser ("toto@toto.com", "Toto", "Toto2"); - $this->assertEquals ($res, 1); + $this->assertSame ($res, "1"); } public function test_listusers2 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->listusers (); - $this->assertEquals ($res, array (array ("email"=>"toto@toto.com", - "firstname"=>"Toto", - "lastname"=>"Toto2"))); + $this->assertSame ($res, array (array ("email"=>"toto@toto.com", + "firstname"=>"Toto", + "lastname"=>"Toto2"))); } public function test_overwritepassword1 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->overwritepassword ("toto@toto.com", "PassW0rd"); - $this->assertEquals ($res, 1); + $this->assertSame ($res, 1); } public function test_checkValidPassword1 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->checkValidPassword ("toto@toto.com", "PassW0rd"); - $this->assertEquals ($res, true); + $this->assertSame ($res, true); } public function test_checkValidPassword2 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->checkValidPassword ("toto@toto.com", "BAD PASSWD"); - $this->assertEquals ($res, false); + $this->assertSame ($res, false); } public function test_changepassword1 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->changepassword ("toto@toto.com", "PassW0rd", "NEW PASS!"); - $this->assertEquals ($res, 1); + $this->assertSame ($res, 1); } public function test_checkValidPassword3 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->checkValidPassword ("toto@toto.com", "PassW0rd"); - $this->assertEquals ($res, false); + $this->assertSame ($res, false); } public function test_checkValidPassword4 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->checkValidPassword ("toto@toto.com", "NEW PASS!"); - $this->assertEquals ($res, true); + $this->assertSame ($res, true); } public function test_updateuser () @@ -88,36 +88,36 @@ class test_userssql extends PHPUnit_Framework_TestCase $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->updateuser ("toto@toto.com", "titi@titi.com", "titi", "titi2"); - $this->assertEquals ($res, 1); + $this->assertSame ($res, 1); } public function test_listusers3 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->listusers (); - $this->assertEquals ($res, array (array ("email"=>"titi@titi.com", - "firstname"=>"titi", - "lastname"=>"titi2"))); + $this->assertSame ($res, array (array ("email"=>"titi@titi.com", + "firstname"=>"titi", + "lastname"=>"titi2"))); } public function test_checkValidPassword5 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->checkValidPassword ("titi@titi.com", "NEW PASS!"); - $this->assertEquals ($res, true); + $this->assertSame ($res, true); } public function test_deluser () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->deluser ("titi@titi.com"); - $this->assertEquals ($res, 1); + $this->assertSame ($res, 1); } public function test_listusers4 () { $userssql = new userssql ("sqlite:///tmp/database.db"); $res = $userssql->listusers (); - $this->assertEquals ($res, array ()); + $this->assertSame ($res, array ()); } }