aboutsummaryrefslogtreecommitdiff
path: root/tests/TestBase.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestBase.php')
-rw-r--r--tests/TestBase.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/TestBase.php b/tests/TestBase.php
index 28bda27..aad772f 100644
--- a/tests/TestBase.php
+++ b/tests/TestBase.php
@@ -75,15 +75,26 @@ class TestBase extends PHPUnit_Framework_TestCase
/**
* Creates a new user in the database.
*
+ * @param string $username Username
+ * @param string $password Password
+ *
* @return integer ID of user
*/
- protected function addUser()
+ protected function addUser($username = null, $password = null)
{
$us = SemanticScuttle_Service_Factory::get('User');
$rand = rand();
+
+ if ($username === null) {
+ $username = 'unittestuser-' . $rand;
+ }
+ if ($password === null) {
+ $password = $rand;
+ }
+
$uid = $us->addUser(
- 'unittestuser-' . $rand,
- $rand,
+ $username,
+ $password,
'unittest-' . $rand . '@example.org'
);
return $uid;