WebTestCase('lost password'); } function testLostPassword() { global $user; // open website $this->get('http://' . BASE_URL); $this->assertText('Lost Password'); $this->clickLink('Lost Password'); // Password Login $this->assertText('Date of Birth', "Field for Date of Birth not found. Did page change?"); // empty fields $this->clickSubmit('Next'); $this->assertText('Unable to match your details with any user accounts on file'); // empty dob $this->setField('email', $user['1']['username']); $this->setField('day', ""); $this->setField('month', ""); $this->setField('year', ""); $this->clickSubmit('Next'); $this->assertText('Unable to match your details with any user accounts on file'); // finish step 1 $this->setField('email', $user['1']['username']); $this->setField('day', $user['1']['dob']['day']); $this->setField('month', $user['1']['dob']['month']); $this->setField('year', $user['1']['dob']['year']); $this->clickSubmit('Next'); $this->assertText('Step 2', "We didn't reach step 2 but we should have"); // No answers and no new password // This sends out an email to support! $this->clickSubmit('Next'); $this->assertText('You failed to get all answers correct'); // Set answers but no new password $this->setField('A1', $user['1']['lostpw']['answers']['1']); $this->setField('A2', $user['1']['lostpw']['answers']['2']); $this->setField('A3', $user['1']['lostpw']['answers']['3']); $this->setField('A4', $user['1']['lostpw']['answers']['4']); $this->setField('A5', $user['1']['lostpw']['answers']['5']); $this->clickSubmit('Next'); $this->assertText('New Pass Phrases specified don', "Missing pass phrase not detected"); // finish step 2 $this->setField('A1', $user['1']['lostpw']['answers']['1']); $this->setField('A2', $user['1']['lostpw']['answers']['2']); $this->setField('A3', $user['1']['lostpw']['answers']['3']); $this->setField('A4', $user['1']['lostpw']['answers']['4']); $this->setField('A5', $user['1']['lostpw']['answers']['5']); $this->setField('newpass1', $user['1']['password']); $this->setField('newpass2', $user['1']['password']); $this->clickSubmit('Next'); $this->assertText('Your Pass Phrase has been updated and your primary email account has been notified of the change.', "Couldn't finish lost password process successfully!"); } } ?>