{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/liveblog/pulls/comments/59073354","id":59073354,"diff_hunk":"@@ -319,6 +319,41 @@ function test_endpoint_get_entries() {\n \n \t/**\n \t * Integration test\n+\t * Test accessing the crud endpoint with an insert action\n+\t */\n+\tfunction test_endpoint_crud_action() {\n+\n+\t\t// Create an author and set as the current user\n+\t\t$author_id = $this->factory->user->create( array(\n+\t\t\t'role' => 'author',\n+\t\t) );\n+\t\twp_set_current_user( $author_id );\n+\n+\t\t// Create a post\n+\t\t$this->factory->post->create();\n+\n+\t\t// The POST data to insert\n+\t\t$post_vars  = $this->build_entry_args( array(\n+\t\t\t'crud_action' => 'insert',\n+\t\t));\n+\n+\t\t// Try to access the endpoint and insert an entry\n+\t\t$request  = new WP_REST_Request( 'POST', self::ENDPOINT_BASE . '/1/crud/' );","path":"t/test-rest-api.php","position":null,"original_position":32,"commit_id":"8c0b69b29093d03bfde9bbcfae0f60ee543b7caa","original_commit_id":"d58f0308a317f52a58368a7caba7d84e46c0bd04","user":{"login":"travisw","id":690843,"avatar_url":"https://avatars.githubusercontent.com/u/690843?v=3","gravatar_id":"","url":"https://api.github.com/users/travisw","html_url":"https://github.com/travisw","followers_url":"https://api.github.com/users/travisw/followers","following_url":"https://api.github.com/users/travisw/following{/other_user}","gists_url":"https://api.github.com/users/travisw/gists{/gist_id}","starred_url":"https://api.github.com/users/travisw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisw/subscriptions","organizations_url":"https://api.github.com/users/travisw/orgs","repos_url":"https://api.github.com/users/travisw/repos","events_url":"https://api.github.com/users/travisw/events{/privacy}","received_events_url":"https://api.github.com/users/travisw/received_events","type":"User","site_admin":false},"body":"I'm making an assumption here that after the table is truncated and 1 record is inserted, that the ID of that record will be 1. But, that could be a dangerous assumption.\r\nI have that ID of 1 hard coded in a few spots in the tests and that should be changed to grab the actual ID that was just inserted.","created_at":"2016-04-08T18:57:35Z","updated_at":"2016-04-08T18:57:35Z","html_url":"https://github.com/Automattic/liveblog/pull/240#discussion_r59073354","pull_request_url":"https://api.github.com/repos/Automattic/liveblog/pulls/240","_links":{"self":{"href":"https://api.github.com/repos/Automattic/liveblog/pulls/comments/59073354"},"html":{"href":"https://github.com/Automattic/liveblog/pull/240#discussion_r59073354"},"pull_request":{"href":"https://api.github.com/repos/Automattic/liveblog/pulls/240"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/liveblog/pulls/240","id":62469686,"html_url":"https://github.com/Automattic/liveblog/pull/240","diff_url":"https://github.com/Automattic/liveblog/pull/240.diff","patch_url":"https://github.com/Automattic/liveblog/pull/240.patch","issue_url":"https://api.github.com/repos/Automattic/liveblog/issues/240","number":240,"state":"open","locked":false,"title":"[WIP] Feature - Adding REST API endpoints","user":{"login":"travisw","id":690843,"avatar_url":"https://avatars.githubusercontent.com/u/690843?v=3","gravatar_id":"","url":"https://api.github.com/users/travisw","html_url":"https://github.com/travisw","followers_url":"https://api.github.com/users/travisw/followers","following_url":"https://api.github.com/users/travisw/following{/other_user}","gists_url":"https://api.github.com/users/travisw/gists{/gist_id}","starred_url":"https://api.github.com/users/travisw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisw/subscriptions","organizations_url":"https://api.github.com/users/travisw/orgs","repos_url":"https://api.github.com/users/travisw/repos","events_url":"https://api.github.com/users/travisw/events{/privacy}","received_events_url":"https://api.github.com/users/travisw/received_events","type":"User","site_admin":false},"body":"Integration of new REST API framework \r\nStill a work in progress.","created_at":"2016-03-10T22:49:06Z","updated_at":"2016-04-08T18:57:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9535f6a756d1c81400b22969fb0528bbdb0ecf7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/liveblog/pulls/240/commits","review_comments_url":"https://api.github.com/repos/Automattic/liveblog/pulls/240/comments","review_comment_url":"https://api.github.com/repos/Automattic/liveblog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/liveblog/issues/240/comments","statuses_url":"https://api.github.com/repos/Automattic/liveblog/statuses/8c0b69b29093d03bfde9bbcfae0f60ee543b7caa","head":{"label":"travisw:feature/rest-api-endpoints","ref":"feature/rest-api-endpoints","sha":"8c0b69b29093d03bfde9bbcfae0f60ee543b7caa","user":{"login":"travisw","id":690843,"avatar_url":"https://avatars.githubusercontent.com/u/690843?v=3","gravatar_id":"","url":"https://api.github.com/users/travisw","html_url":"https://github.com/travisw","followers_url":"https://api.github.com/users/travisw/followers","following_url":"https://api.github.com/users/travisw/following{/other_user}","gists_url":"https://api.github.com/users/travisw/gists{/gist_id}","starred_url":"https://api.github.com/users/travisw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisw/subscriptions","organizations_url":"https://api.github.com/users/travisw/orgs","repos_url":"https://api.github.com/users/travisw/repos","events_url":"https://api.github.com/users/travisw/events{/privacy}","received_events_url":"https://api.github.com/users/travisw/received_events","type":"User","site_admin":false},"repo":{"id":52029036,"name":"liveblog","full_name":"travisw/liveblog","owner":{"login":"travisw","id":690843,"avatar_url":"https://avatars.githubusercontent.com/u/690843?v=3","gravatar_id":"","url":"https://api.github.com/users/travisw","html_url":"https://github.com/travisw","followers_url":"https://api.github.com/users/travisw/followers","following_url":"https://api.github.com/users/travisw/following{/other_user}","gists_url":"https://api.github.com/users/travisw/gists{/gist_id}","starred_url":"https://api.github.com/users/travisw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisw/subscriptions","organizations_url":"https://api.github.com/users/travisw/orgs","repos_url":"https://api.github.com/users/travisw/repos","events_url":"https://api.github.com/users/travisw/events{/privacy}","received_events_url":"https://api.github.com/users/travisw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/travisw/liveblog","description":"Liveblogging done right. Using WordPress.","fork":true,"url":"https://api.github.com/repos/travisw/liveblog","forks_url":"https://api.github.com/repos/travisw/liveblog/forks","keys_url":"https://api.github.com/repos/travisw/liveblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travisw/liveblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travisw/liveblog/teams","hooks_url":"https://api.github.com/repos/travisw/liveblog/hooks","issue_events_url":"https://api.github.com/repos/travisw/liveblog/issues/events{/number}","events_url":"https://api.github.com/repos/travisw/liveblog/events","assignees_url":"https://api.github.com/repos/travisw/liveblog/assignees{/user}","branches_url":"https://api.github.com/repos/travisw/liveblog/branches{/branch}","tags_url":"https://api.github.com/repos/travisw/liveblog/tags","blobs_url":"https://api.github.com/repos/travisw/liveblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travisw/liveblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travisw/liveblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/travisw/liveblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travisw/liveblog/statuses/{sha}","languages_url":"https://api.github.com/repos/travisw/liveblog/languages","stargazers_url":"https://api.github.com/repos/travisw/liveblog/stargazers","contributors_url":"https://api.github.com/repos/travisw/liveblog/contributors","subscribers_url":"https://api.github.com/repos/travisw/liveblog/subscribers","subscription_url":"https://api.github.com/repos/travisw/liveblog/subscription","commits_url":"https://api.github.com/repos/travisw/liveblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/travisw/liveblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/travisw/liveblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/travisw/liveblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/travisw/liveblog/contents/{+path}","compare_url":"https://api.github.com/repos/travisw/liveblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travisw/liveblog/merges","archive_url":"https://api.github.com/repos/travisw/liveblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travisw/liveblog/downloads","issues_url":"https://api.github.com/repos/travisw/liveblog/issues{/number}","pulls_url":"https://api.github.com/repos/travisw/liveblog/pulls{/number}","milestones_url":"https://api.github.com/repos/travisw/liveblog/milestones{/number}","notifications_url":"https://api.github.com/repos/travisw/liveblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travisw/liveblog/labels{/name}","releases_url":"https://api.github.com/repos/travisw/liveblog/releases{/id}","deployments_url":"https://api.github.com/repos/travisw/liveblog/deployments","created_at":"2016-02-18T18:29:26Z","updated_at":"2016-02-18T18:29:27Z","pushed_at":"2016-04-08T17:27:24Z","git_url":"git://github.com/travisw/liveblog.git","ssh_url":"git@github.com:travisw/liveblog.git","clone_url":"https://github.com/travisw/liveblog.git","svn_url":"https://github.com/travisw/liveblog","homepage":"https://wordpress.org/plugins/liveblog/","size":8290,"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:develop","ref":"develop","sha":"83ca35d25e2a7ea399bc229e682f043edb905c0e","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":4542883,"name":"liveblog","full_name":"Automattic/liveblog","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/liveblog","description":"Liveblogging done right. Using WordPress.","fork":false,"url":"https://api.github.com/repos/Automattic/liveblog","forks_url":"https://api.github.com/repos/Automattic/liveblog/forks","keys_url":"https://api.github.com/repos/Automattic/liveblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/liveblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/liveblog/teams","hooks_url":"https://api.github.com/repos/Automattic/liveblog/hooks","issue_events_url":"https://api.github.com/repos/Automattic/liveblog/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/liveblog/events","assignees_url":"https://api.github.com/repos/Automattic/liveblog/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/liveblog/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/liveblog/tags","blobs_url":"https://api.github.com/repos/Automattic/liveblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/liveblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/liveblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/liveblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/liveblog/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/liveblog/languages","stargazers_url":"https://api.github.com/repos/Automattic/liveblog/stargazers","contributors_url":"https://api.github.com/repos/Automattic/liveblog/contributors","subscribers_url":"https://api.github.com/repos/Automattic/liveblog/subscribers","subscription_url":"https://api.github.com/repos/Automattic/liveblog/subscription","commits_url":"https://api.github.com/repos/Automattic/liveblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/liveblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/liveblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/liveblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/liveblog/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/liveblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/liveblog/merges","archive_url":"https://api.github.com/repos/Automattic/liveblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/liveblog/downloads","issues_url":"https://api.github.com/repos/Automattic/liveblog/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/liveblog/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/liveblog/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/liveblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/liveblog/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/liveblog/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/liveblog/deployments","created_at":"2012-06-04T03:14:54Z","updated_at":"2016-04-06T01:27:52Z","pushed_at":"2016-04-08T17:27:24Z","git_url":"git://github.com/Automattic/liveblog.git","ssh_url":"git@github.com:Automattic/liveblog.git","clone_url":"https://github.com/Automattic/liveblog.git","svn_url":"https://github.com/Automattic/liveblog","homepage":"https://wordpress.org/plugins/liveblog/","size":8361,"stargazers_count":227,"watchers_count":227,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":76,"forks":66,"open_issues":76,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/liveblog/pulls/240"},"html":{"href":"https://github.com/Automattic/liveblog/pull/240"},"issue":{"href":"https://api.github.com/repos/Automattic/liveblog/issues/240"},"comments":{"href":"https://api.github.com/repos/Automattic/liveblog/issues/240/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/liveblog/pulls/240/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/liveblog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/liveblog/pulls/240/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/liveblog/statuses/8c0b69b29093d03bfde9bbcfae0f60ee543b7caa"}}}}