summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-10-08 23:17:51 +0200
committerAndreas Fischer <bantu@owncloud.com>2013-10-08 23:17:51 +0200
commitfe64f7b900eed4d86eb1d6907d31ecb099989ab7 (patch)
tree0bea7cad2cfb9c78d8fa6c9a7155bfe3da94df3a /tests
parent24e99016a924b296685abc290f12d9f533f684d5 (diff)
parent75588fc0b6556d64825e842d4cf62ea572792723 (diff)
downloadnextcloud-server-fe64f7b900eed4d86eb1d6907d31ecb099989ab7.tar.gz
nextcloud-server-fe64f7b900eed4d86eb1d6907d31ecb099989ab7.zip
Merge pull request #5032 from owncloud/fixing-5006-master
Test OC_User_Database in Test_User_Database instead of OC_User_Dummy. * owncloud/fixing-5006-master: Use strict comparison === instead of ==. Adjust return value tests for checkPassword() to what OC_User_Example says. Make OC_User_Dummy::checkPassword() compatible with OC_User_Example. Use parent:: in Test_User_Database::getUser(). Test_User_Backend::getUser() does not return an array, it returns a string. Test OC_User_Database in Test_User_Database instead of OC_User_Dummy.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/user/backend.php8
-rw-r--r--tests/lib/user/database.php9
2 files changed, 6 insertions, 11 deletions
diff --git a/tests/lib/user/backend.php b/tests/lib/user/backend.php
index 40674424c96..1384c54a921 100644
--- a/tests/lib/user/backend.php
+++ b/tests/lib/user/backend.php
@@ -39,7 +39,7 @@ abstract class Test_User_Backend extends PHPUnit_Framework_TestCase {
/**
* get a new unique user name
* test cases can override this in order to clean up created user
- * @return array
+ * @return string
*/
public function getUser() {
return uniqid('test_');
@@ -82,8 +82,8 @@ abstract class Test_User_Backend extends PHPUnit_Framework_TestCase {
$this->assertTrue($this->backend->userExists($name1));
$this->assertTrue($this->backend->userExists($name2));
- $this->assertTrue($this->backend->checkPassword($name1, 'pass1'));
- $this->assertTrue($this->backend->checkPassword($name2, 'pass2'));
+ $this->assertSame($name1, $this->backend->checkPassword($name1, 'pass1'));
+ $this->assertSame($name2, $this->backend->checkPassword($name2, 'pass2'));
$this->assertFalse($this->backend->checkPassword($name1, 'pass2'));
$this->assertFalse($this->backend->checkPassword($name2, 'pass1'));
@@ -93,7 +93,7 @@ abstract class Test_User_Backend extends PHPUnit_Framework_TestCase {
$this->backend->setPassword($name1, 'newpass1');
$this->assertFalse($this->backend->checkPassword($name1, 'pass1'));
- $this->assertTrue($this->backend->checkPassword($name1, 'newpass1'));
+ $this->assertSame($name1, $this->backend->checkPassword($name1, 'newpass1'));
$this->assertFalse($this->backend->checkPassword($name2, 'newpass1'));
}
}
diff --git a/tests/lib/user/database.php b/tests/lib/user/database.php
index fe7d87c44de..d7cc39ae387 100644
--- a/tests/lib/user/database.php
+++ b/tests/lib/user/database.php
@@ -21,19 +21,14 @@
*/
class Test_User_Database extends Test_User_Backend {
- /**
- * get a new unique user name
- * test cases can override this in order to clean up created user
- * @return array
- */
public function getUser() {
- $user=uniqid('test_');
+ $user = parent::getUser();
$this->users[]=$user;
return $user;
}
public function setUp() {
- $this->backend=new OC_User_Dummy();
+ $this->backend=new OC_User_Database();
}
public function tearDown() {