GitHub PullRequestReviewCommentEvent at 2014-02-19 15:52:02
Repository: phpbb
Actor: EXreaction
Payload: {"comment":{"url":"https://api.github.com/repos/phpbb/phpbb/pulls/comments/9869569","id":9869569,"diff_hunk":"@@ -0,0 +1,120 @@\n+<?php\n+/**\n+*\n+* @package testing\n+* @copyright (c) 2014 phpBB Group\n+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2\n+*\n+*/\n+\n+/**\n+* @group functional\n+*/\n+class phpbb_functional_user_password_reset_test extends phpbb_functional_test_case\n+{\n+\tprotected $user_data;\n+\n+\tpublic function test_password_reset()\n+\t{\n+\t\t$this->add_lang('ucp');\n+\t\t$user_id = $this->create_user('reset-password-test-user');\n+\n+\t\t$crawler = self::request('GET', \"ucp.php?mode=sendpassword&sid={$this->sid}\");\n+\t\t$form = $crawler->selectButton('submit')->form(array(\n+\t\t\t'username'\t=> 'reset-password-test-user',\n+\t\t));\n+\t\t$crawler = self::submit($form);\n+\t\t$this->assertContainsLang('NO_EMAIL_USER', $crawler->text());\n+\n+\t\t$crawler = self::request('GET', \"ucp.php?mode=sendpassword&sid={$this->sid}\");\n+\t\t$form = $crawler->selectButton('submit')->form(array(\n+\t\t\t'username'\t=> 'reset-password-test-user',\n+\t\t\t'email'\t\t=> 'nobody@example.com',\n+\t\t));\n+\t\t$crawler = self::submit($form);\n+\t\t$this->assertContainsLang('PASSWORD_UPDATED', $crawler->text());\n+\n+\t\t// Make sure we know the password\n+\t\t$db = $this->get_db();\n+\t\t$this->passwords_manager = $this->get_passwords_manager();\n+\t\t$sql = 'UPDATE ' . USERS_TABLE . \"\n+\t\t\tSET user_newpasswd = '\" . $db->sql_escape($this->passwords_manager->hash('reset-password-test-user')) . \"'\n+\t\t\tWHERE user_id = \" . $user_id;\n+\t\t$db->sql_query($sql);\n+\t}\n+\n+\tpublic function test_login_after_reset()\n+\t{\n+\t\t$this->get_user_data();\n+\t\t$this->assertNotNull($this->user_data['user_actkey']);\n+\t\t$this->assertNotNull($this->user_data['user_newpasswd']);\n+\t\t$this->login('reset-password-test-user');","path":"tests/functional/user_password_reset_test.php","position":51,"original_position":51,"commit_id":"c82967d92b03873acdba074c12efea062160d91c","original_commit_id":"c82967d92b03873acdba074c12efea062160d91c","user":{"login":"EXreaction","id":214383,"avatar_url":"https://gravatar.com/avatar/e6a9c7bc69530add787ed2c9175931cb?d=https%3A%2F%2Fidenticons.github.com%2F7b60d7647c96e552c72a378aaafecafc.png&r=x","gravatar_id":"e6a9c7bc69530add787ed2c9175931cb","url":"https://api.github.com/users/EXreaction","html_url":"https://github.com/EXreaction","followers_url":"https://api.github.com/users/EXreaction/followers","following_url":"https://api.github.com/users/EXreaction/following{/other_user}","gists_url":"https://api.github.com/users/EXreaction/gists{/gist_id}","starred_url":"https://api.github.com/users/EXreaction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EXreaction/subscriptions","organizations_url":"https://api.github.com/users/EXreaction/orgs","repos_url":"https://api.github.com/users/EXreaction/repos","events_url":"https://api.github.com/users/EXreaction/events{/privacy}","received_events_url":"https://api.github.com/users/EXreaction/received_events","type":"User","site_admin":false},"body":"This login isn't required. Next task is activating a password, which shouldn't require being logged in first (you should actually make sure the user is logged out).","created_at":"2014-02-19T15:52:02Z","updated_at":"2014-02-19T15:52:02Z","html_url":"https://github.com/phpbb/phpbb/pull/2025#discussion_r9869569","pull_request_url":"https://api.github.com/repos/phpbb/phpbb/pulls/2025","_links":{"self":{"href":"https://api.github.com/repos/phpbb/phpbb/pulls/comments/9869569"},"html":{"href":"https://github.com/phpbb/phpbb/pull/2025#discussion_r9869569"},"pull_request":{"href":"https://api.github.com/repos/phpbb/phpbb/pulls/2025"}}}}