diff options
| author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-03-28 18:04:53 +0000 | 
|---|---|---|
| committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-03-28 18:04:53 +0000 | 
| commit | ccabc1cdfa6605f4454653360ec00dc171368556 (patch) | |
| tree | 242ebbbc27a906ebb35f86d5ddb904d9a6874da5 | |
| parent | 78bac4580c25ad0f39d6e83aa3470f3d2d64806a (diff) | |
| download | semanticscuttle-ccabc1cdfa6605f4454653360ec00dc171368556.tar.gz semanticscuttle-ccabc1cdfa6605f4454653360ec00dc171368556.tar.bz2  | |
support username and password change
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@699 b3834d28-1941-0410-a4f8-b48e95affb8f
| -rw-r--r-- | tests/TestBase.php | 17 | 
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;  | 
