From 652fd5d51718e1854f93b4d15cf8c0b59fb92d5c Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Thu, 26 Jul 2007 14:30:32 +0000 Subject: [PATCH] Remove explicit user::login() call from create_and_login_user() since user::create() calls user::login() if the user creation is successful --- unit_test/test_common.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/unit_test/test_common.php b/unit_test/test_common.php index d9ca97e..1573428 100644 --- a/unit_test/test_common.php +++ b/unit_test/test_common.php @@ -55,7 +55,9 @@ function create_and_login_user($sTestEmail, $sTestPassword) $oUser = new User(); } - /* create the user */ + // create the user + // NOTE: user::create() will call user::login() to login the user + // if the user creation is successful $retval = $oUser->create($sTestEmail, $sTestPassword, "Test user", "20051020"); if($retval != SUCCESS) { @@ -69,14 +71,6 @@ function create_and_login_user($sTestEmail, $sTestPassword) return false; } - /* login the user */ - $retval = $oUser->login($sTestEmail, $sTestPassword); - if($retval != SUCCESS) - { - error("Got '".$retval."' instead of SUCCESS(".SUCCESS.")"); - return false; - } - return $oUser; }