{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/31060716","id":31060716,"diff_hunk":"@@ -0,0 +1,55 @@\n+<?php\n+require dirname( __FILE__ ) . '/../../../modules/sharedaddy/recaptcha.php';\n+\n+class WP_Test_Jetpack_ReCaptcha extends WP_UnitTestCase {\n+\n+\tpublic function setUp() {\n+\t\tparent::setUp();\n+\n+\t\t$this->site_key   = defined( 'RECAPTCHA_PUBLIC_KEY' ) ? RECAPTCHA_PUBLIC_KEY : 'sitekey';\n+\t\t$this->secret_key = defined( 'RECAPTCHA_PRIVATE_KEY' ) ? RECAPTCHA_PUBLIC_KEY : 'secretkey';\n+\t\t$this->recaptcha  = new Jetpack_ReCaptcha( $this->site_key, $this->secret_key );\n+\t}\n+\n+\tpublic function test_get_default_config() {\n+\t\t$default_config = $this->recaptcha->get_default_config();\n+\t\t$this->assertNotEmpty( $default_config );\n+\t\t$this->assertArrayHasKey( 'language', $default_config );\n+\t\t$this->assertArrayHasKey( 'tag_class', $default_config );\n+\t\t$this->assertArrayHasKey( 'tag_attributes', $default_config );\n+\t\t$this->assertNotEmpty( $default_config['tag_attributes'] );\n+\t\t$this->assertArrayHasKey( 'theme', $default_config['tag_attributes'] );\n+\t\t$this->assertArrayHasKey( 'type', $default_config['tag_attributes'] );\n+\t\t$this->assertArrayHasKey( 'tabindex', $default_config['tag_attributes'] );\n+\t}\n+\n+\tpublic function test_verify() {\n+\t\t// Empty response returns WP_Error.\n+\t\t$result = $this->recaptcha->verify( '', '127.0.0.1' );\n+\t\t$this->assertInstanceOf( 'WP_Error', $result );\n+\n+\t\t// TODO: test succeed and failed respones. Make sure to mock wp_remote_post.","path":"tests/modules/sharedaddy/test_class.recaptcha.php","position":31,"original_position":31,"commit_id":"913c165c24c757a3b223bbe89597a577ac759c74","original_commit_id":"913c165c24c757a3b223bbe89597a577ac759c74","user":{"login":"mjangda","id":86105,"avatar_url":"https://avatars.githubusercontent.com/u/86105?v=3","gravatar_id":"","url":"https://api.github.com/users/mjangda","html_url":"https://github.com/mjangda","followers_url":"https://api.github.com/users/mjangda/followers","following_url":"https://api.github.com/users/mjangda/following{/other_user}","gists_url":"https://api.github.com/users/mjangda/gists{/gist_id}","starred_url":"https://api.github.com/users/mjangda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjangda/subscriptions","organizations_url":"https://api.github.com/users/mjangda/orgs","repos_url":"https://api.github.com/users/mjangda/repos","events_url":"https://api.github.com/users/mjangda/events{/privacy}","received_events_url":"https://api.github.com/users/mjangda/received_events","type":"User","site_admin":false},"body":"Can we actually implement this `TODO`, since it's probably the most useful set of tests to have?","created_at":"2015-05-26T17:55:22Z","updated_at":"2015-05-26T17:55:22Z","html_url":"https://github.com/Automattic/jetpack/pull/2152#discussion_r31060716","pull_request_url":"https://api.github.com/repos/Automattic/jetpack/pulls/2152","_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments/31060716"},"html":{"href":"https://github.com/Automattic/jetpack/pull/2152#discussion_r31060716"},"pull_request":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2152"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/2152","id":35882302,"html_url":"https://github.com/Automattic/jetpack/pull/2152","diff_url":"https://github.com/Automattic/jetpack/pull/2152.diff","patch_url":"https://github.com/Automattic/jetpack/pull/2152.patch","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/2152","number":2152,"state":"open","locked":false,"title":"Update reCAPTCHA to use reCAPTCHA API version 2.0","user":{"login":"gedex","id":78313,"avatar_url":"https://avatars.githubusercontent.com/u/78313?v=3","gravatar_id":"","url":"https://api.github.com/users/gedex","html_url":"https://github.com/gedex","followers_url":"https://api.github.com/users/gedex/followers","following_url":"https://api.github.com/users/gedex/following{/other_user}","gists_url":"https://api.github.com/users/gedex/gists{/gist_id}","starred_url":"https://api.github.com/users/gedex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedex/subscriptions","organizations_url":"https://api.github.com/users/gedex/orgs","repos_url":"https://api.github.com/users/gedex/repos","events_url":"https://api.github.com/users/gedex/events{/privacy}","received_events_url":"https://api.github.com/users/gedex/received_events","type":"User","site_admin":false},"body":"This change introduces new class `Jetpack_ReCaptcha` that handles verification and rendering HTML of reCAPTCHA widget. Previous lib, `recaptchalib.php`, is replaced by `Jetpack_ReCaptcha`. Initial test for `Jetpack_ReCaptcha` is also included in this change.\r\n\r\nThis fixes #1368. ","created_at":"2015-05-20T22:18:44Z","updated_at":"2015-05-26T17:55:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94858e792ec8f56a1942f3c11a3250306bf220d7","assignee":null,"milestone":{"url":"https://api.github.com/repos/Automattic/jetpack/milestones/4","html_url":"https://github.com/Automattic/jetpack/milestones/vFuture","labels_url":"https://api.github.com/repos/Automattic/jetpack/milestones/4/labels","id":557425,"number":4,"title":"vFuture","description":"Items that are candidates to be included in a future release not currently vNext.","creator":{"login":"blobaugh","id":806179,"avatar_url":"https://avatars.githubusercontent.com/u/806179?v=3","gravatar_id":"","url":"https://api.github.com/users/blobaugh","html_url":"https://github.com/blobaugh","followers_url":"https://api.github.com/users/blobaugh/followers","following_url":"https://api.github.com/users/blobaugh/following{/other_user}","gists_url":"https://api.github.com/users/blobaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/blobaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blobaugh/subscriptions","organizations_url":"https://api.github.com/users/blobaugh/orgs","repos_url":"https://api.github.com/users/blobaugh/repos","events_url":"https://api.github.com/users/blobaugh/events{/privacy}","received_events_url":"https://api.github.com/users/blobaugh/received_events","type":"User","site_admin":false},"open_issues":136,"closed_issues":34,"state":"open","created_at":"2014-02-03T16:55:44Z","updated_at":"2015-05-26T15:08:43Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/jetpack/pulls/2152/commits","review_comments_url":"https://api.github.com/repos/Automattic/jetpack/pulls/2152/comments","review_comment_url":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/2152/comments","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/913c165c24c757a3b223bbe89597a577ac759c74","head":{"label":"gedex:issue-1368-update-recaptcha","ref":"issue-1368-update-recaptcha","sha":"913c165c24c757a3b223bbe89597a577ac759c74","user":{"login":"gedex","id":78313,"avatar_url":"https://avatars.githubusercontent.com/u/78313?v=3","gravatar_id":"","url":"https://api.github.com/users/gedex","html_url":"https://github.com/gedex","followers_url":"https://api.github.com/users/gedex/followers","following_url":"https://api.github.com/users/gedex/following{/other_user}","gists_url":"https://api.github.com/users/gedex/gists{/gist_id}","starred_url":"https://api.github.com/users/gedex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedex/subscriptions","organizations_url":"https://api.github.com/users/gedex/orgs","repos_url":"https://api.github.com/users/gedex/repos","events_url":"https://api.github.com/users/gedex/events{/privacy}","received_events_url":"https://api.github.com/users/gedex/received_events","type":"User","site_admin":false},"repo":{"id":18806088,"name":"jetpack","full_name":"gedex/jetpack","owner":{"login":"gedex","id":78313,"avatar_url":"https://avatars.githubusercontent.com/u/78313?v=3","gravatar_id":"","url":"https://api.github.com/users/gedex","html_url":"https://github.com/gedex","followers_url":"https://api.github.com/users/gedex/followers","following_url":"https://api.github.com/users/gedex/following{/other_user}","gists_url":"https://api.github.com/users/gedex/gists{/gist_id}","starred_url":"https://api.github.com/users/gedex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedex/subscriptions","organizations_url":"https://api.github.com/users/gedex/orgs","repos_url":"https://api.github.com/users/gedex/repos","events_url":"https://api.github.com/users/gedex/events{/privacy}","received_events_url":"https://api.github.com/users/gedex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gedex/jetpack","description":"Jetpack supercharges your self‑hosted WordPress site with the awesome cloud power of WordPress.com.","fork":true,"url":"https://api.github.com/repos/gedex/jetpack","forks_url":"https://api.github.com/repos/gedex/jetpack/forks","keys_url":"https://api.github.com/repos/gedex/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gedex/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gedex/jetpack/teams","hooks_url":"https://api.github.com/repos/gedex/jetpack/hooks","issue_events_url":"https://api.github.com/repos/gedex/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/gedex/jetpack/events","assignees_url":"https://api.github.com/repos/gedex/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/gedex/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/gedex/jetpack/tags","blobs_url":"https://api.github.com/repos/gedex/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gedex/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gedex/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/gedex/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gedex/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/gedex/jetpack/languages","stargazers_url":"https://api.github.com/repos/gedex/jetpack/stargazers","contributors_url":"https://api.github.com/repos/gedex/jetpack/contributors","subscribers_url":"https://api.github.com/repos/gedex/jetpack/subscribers","subscription_url":"https://api.github.com/repos/gedex/jetpack/subscription","commits_url":"https://api.github.com/repos/gedex/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/gedex/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/gedex/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/gedex/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/gedex/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/gedex/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gedex/jetpack/merges","archive_url":"https://api.github.com/repos/gedex/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gedex/jetpack/downloads","issues_url":"https://api.github.com/repos/gedex/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/gedex/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/gedex/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/gedex/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gedex/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/gedex/jetpack/releases{/id}","created_at":"2014-04-15T15:52:54Z","updated_at":"2015-05-19T08:29:28Z","pushed_at":"2015-05-21T16:48:31Z","git_url":"git://github.com/gedex/jetpack.git","ssh_url":"git@github.com:gedex/jetpack.git","clone_url":"https://github.com/gedex/jetpack.git","svn_url":"https://github.com/gedex/jetpack","homepage":"http://jetpack.me","size":51539,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"b2e4cbb2091bccef79ff130766c29b80b9e75496","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":15231212,"name":"jetpack","full_name":"Automattic/jetpack","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/jetpack","description":"Your WordPress, Streamlined.","fork":false,"url":"https://api.github.com/repos/Automattic/jetpack","forks_url":"https://api.github.com/repos/Automattic/jetpack/forks","keys_url":"https://api.github.com/repos/Automattic/jetpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/jetpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/jetpack/teams","hooks_url":"https://api.github.com/repos/Automattic/jetpack/hooks","issue_events_url":"https://api.github.com/repos/Automattic/jetpack/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/jetpack/events","assignees_url":"https://api.github.com/repos/Automattic/jetpack/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/jetpack/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/jetpack/tags","blobs_url":"https://api.github.com/repos/Automattic/jetpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/jetpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/jetpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/jetpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/jetpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/jetpack/languages","stargazers_url":"https://api.github.com/repos/Automattic/jetpack/stargazers","contributors_url":"https://api.github.com/repos/Automattic/jetpack/contributors","subscribers_url":"https://api.github.com/repos/Automattic/jetpack/subscribers","subscription_url":"https://api.github.com/repos/Automattic/jetpack/subscription","commits_url":"https://api.github.com/repos/Automattic/jetpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/jetpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/jetpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/jetpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/jetpack/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/jetpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/jetpack/merges","archive_url":"https://api.github.com/repos/Automattic/jetpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/jetpack/downloads","issues_url":"https://api.github.com/repos/Automattic/jetpack/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/jetpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/jetpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/jetpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/jetpack/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/jetpack/releases{/id}","created_at":"2013-12-16T16:43:01Z","updated_at":"2015-05-24T12:04:38Z","pushed_at":"2015-05-26T17:15:52Z","git_url":"git://github.com/Automattic/jetpack.git","ssh_url":"git@github.com:Automattic/jetpack.git","clone_url":"https://github.com/Automattic/jetpack.git","svn_url":"https://github.com/Automattic/jetpack","homepage":"http://jetpack.me","size":296677,"stargazers_count":340,"watchers_count":340,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"open_issues_count":584,"forks":236,"open_issues":584,"watchers":340,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2152"},"html":{"href":"https://github.com/Automattic/jetpack/pull/2152"},"issue":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/2152"},"comments":{"href":"https://api.github.com/repos/Automattic/jetpack/issues/2152/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2152/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/jetpack/pulls/2152/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/jetpack/statuses/913c165c24c757a3b223bbe89597a577ac759c74"}}}}