Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/tests/controllers/users_controller.test.php
diff options
context:
space:
mode:
Diffstat (limited to 'site/app/tests/controllers/users_controller.test.php')
-rw-r--r--site/app/tests/controllers/users_controller.test.php15
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'];