diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-06-11 11:59:20 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-06-11 11:59:20 (GMT) |
commit | 15238e13918a019bdc020c3eeafa5e01c810bbf1 (patch) | |
tree | e11aa9a28033dbfca2ede7169da745518bf3e992 /site/app/tests/controllers/users_controller.test.php | |
parent | e9361d633e8163e508a4dcde36c25c94f7e8b272 (diff) |
Fake v2 production branchv2
Diffstat (limited to 'site/app/tests/controllers/users_controller.test.php')
-rw-r--r-- | site/app/tests/controllers/users_controller.test.php | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/site/app/tests/controllers/users_controller.test.php b/site/app/tests/controllers/users_controller.test.php index e45e495..c81ebb6 100644 --- a/site/app/tests/controllers/users_controller.test.php +++ b/site/app/tests/controllers/users_controller.test.php @@ -109,10 +109,7 @@ class UsersTest extends UnitTestCase { if ($field == 'password' || $field == 'confirmpw') continue; $this->assertEqual($this->testdata[$field], $storeddata['User'][$field], "Data for $field stored"); } - - $validPassword = $this->controller->User->_checkPassword( - $this->testdata['password'], $storeddata['User']['password']); - $this->assertTrue($validPassword, "Data for password stored"); + $this->assertEqual(md5($this->testdata['password']), $storeddata['User']['password'], "Data for password stored"); $this->assertTrue(preg_match('/^[0-9a-f]{32}$/', strtolower($storeddata['User']['confirmationcode'])), 'Creating confirmation code'); @@ -214,17 +211,11 @@ class UsersTest extends UnitTestCase { $data['password'] = 'my_new_password'; $data['confirmpw'] = 'my_new_password'; - // Start the reset process so we can get a valid reset code. - $resetCode = $this->controller->User->setResetCode($bill['User']['id']); - $this->controller->data['User'] = $data; - $this->helper->callControllerAction($this->controller, 'pwreset', $this, array($bill['User']['id'], $resetCode)); + $this->helper->callControllerAction($this->controller, 'pwreset', $this, array($bill['User']['id'], md5($oldpw))); $newdata = $this->controller->User->find("User.email = 'bill@ms.com'"); - - $validPassword = $this->controller->User->_checkPassword( - 'my_new_password' , $newdata['User']['password']); - $this->assertTrue($validPassword, 'Password reset'); + $this->assertEqual($newdata['User']['password'], md5('my_new_password'), 'Password reset'); // reset the pw $this->controller->User->id = $bill['User']['id']; |