]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
support username and password change
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sun, 28 Mar 2010 18:04:53 +0000 (18:04 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sun, 28 Mar 2010 18:04:53 +0000 (18:04 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@699 b3834d28-1941-0410-a4f8-b48e95affb8f

tests/TestBase.php

index 28bda27ad475d2574700fe9507397f21563b066e..aad772f7ea3811ce5cab720b87d8a99e623c6cd5 100644 (file)
@@ -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;