{"action":"created","comment":{"url":"https://api.github.com/repos/nerdstein/key/pulls/comments/35776245","id":35776245,"diff_hunk":"@@ -0,0 +1,136 @@\n+<?php\n+/**\n+ * Provides \\Drupal\\Tests\\key\\KeyManagerTest.php\n+ */\n+\n+namespace Drupal\\Tests\\key;\n+\n+use Drupal\\key\\Plugin\\KeyType\\SimpleKey;\n+use Drupal\\key\\Entity\\Key;\n+use Drupal\\key\\KeyManager;\n+\n+class KeyManagerTest extends KeyTestBase {","path":"tests/src/KeyManagerTest.php","position":12,"original_position":12,"commit_id":"62de84ad41b3275db7dbf85867f61528703b4fec","original_commit_id":"5844fb1fb126860bd9fa69d4b015fbd91587c9f8","user":{"login":"nerdstein","id":966547,"avatar_url":"https://avatars.githubusercontent.com/u/966547?v=3","gravatar_id":"","url":"https://api.github.com/users/nerdstein","html_url":"https://github.com/nerdstein","followers_url":"https://api.github.com/users/nerdstein/followers","following_url":"https://api.github.com/users/nerdstein/following{/other_user}","gists_url":"https://api.github.com/users/nerdstein/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdstein/subscriptions","organizations_url":"https://api.github.com/users/nerdstein/orgs","repos_url":"https://api.github.com/users/nerdstein/repos","events_url":"https://api.github.com/users/nerdstein/events{/privacy}","received_events_url":"https://api.github.com/users/nerdstein/received_events","type":"User","site_admin":false},"body":"Perfect. OK","created_at":"2015-07-29T15:56:49Z","updated_at":"2015-07-29T15:56:49Z","html_url":"https://github.com/nerdstein/key/pull/10#discussion_r35776245","pull_request_url":"https://api.github.com/repos/nerdstein/key/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/nerdstein/key/pulls/comments/35776245"},"html":{"href":"https://github.com/nerdstein/key/pull/10#discussion_r35776245"},"pull_request":{"href":"https://api.github.com/repos/nerdstein/key/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/nerdstein/key/pulls/10","id":40967231,"html_url":"https://github.com/nerdstein/key/pull/10","diff_url":"https://github.com/nerdstein/key/pull/10.diff","patch_url":"https://github.com/nerdstein/key/pull/10.patch","issue_url":"https://api.github.com/repos/nerdstein/key/issues/10","number":10,"state":"open","locked":false,"title":"Add dependency injection to KeyManager","user":{"login":"mradcliffe","id":328497,"avatar_url":"https://avatars.githubusercontent.com/u/328497?v=3","gravatar_id":"","url":"https://api.github.com/users/mradcliffe","html_url":"https://github.com/mradcliffe","followers_url":"https://api.github.com/users/mradcliffe/followers","following_url":"https://api.github.com/users/mradcliffe/following{/other_user}","gists_url":"https://api.github.com/users/mradcliffe/gists{/gist_id}","starred_url":"https://api.github.com/users/mradcliffe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mradcliffe/subscriptions","organizations_url":"https://api.github.com/users/mradcliffe/orgs","repos_url":"https://api.github.com/users/mradcliffe/repos","events_url":"https://api.github.com/users/mradcliffe/events{/privacy}","received_events_url":"https://api.github.com/users/mradcliffe/received_events","type":"User","site_admin":false},"body":"This branch changes the KeyManager service to use dependency injection, and adds PHP Unit tests.\r\n\r\nThere are two failing tests due to code errors inside KeyManager:\r\n\r\n1. getKeys() specifies a string argument but loadMultiple takes an array argument.\r\n2. getDefaultKeyContents() uses a method getKeyContents but this does not exist.\r\n\r\nI added phpunit.xml inside the module directory which is configured to use Drupal bootstrap like how I do it with [Xero](https://github.com/mradcliffe/xero). This allows to run unit tests like so:\r\n\r\n```bash\r\npath/to/core/vendor/bin/phpunit\r\n```\r\n\r\n```\r\nCode Coverage Report:     \r\n  2015-07-28 01:19:31     \r\n                          \r\n Summary:                 \r\n  Classes:  9.09% (1/11)  \r\n  Methods: 26.32% (10/38) \r\n  Lines:   12.90% (24/186)\r\n\r\n\\Drupal\\key::KeyManager\r\n  Methods:  83.33% ( 5/ 6)   Lines:  86.67% ( 13/ 15)\r\n\\Drupal\\key::KeyTypeBase\r\n  Methods:  40.00% ( 2/ 5)   Lines:  55.56% (  5/  9)\r\n\\Drupal\\key\\Entity::Key\r\n  Methods:  33.33% ( 1/ 3)   Lines:  60.00% (  3/  5)\r\n\\Drupal\\key\\Plugin\\KeyType::SimpleKey\r\n  Methods:  40.00% ( 2/ 5)   Lines:  23.08% (  3/ 13)\r\n```","created_at":"2015-07-28T01:23:13Z","updated_at":"2015-07-29T15:56:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7bf5f019d81cc69ef4e1bb0bd611a86ece44b46","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nerdstein/key/pulls/10/commits","review_comments_url":"https://api.github.com/repos/nerdstein/key/pulls/10/comments","review_comment_url":"https://api.github.com/repos/nerdstein/key/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nerdstein/key/issues/10/comments","statuses_url":"https://api.github.com/repos/nerdstein/key/statuses/62de84ad41b3275db7dbf85867f61528703b4fec","head":{"label":"mradcliffe:dependency-injection","ref":"dependency-injection","sha":"62de84ad41b3275db7dbf85867f61528703b4fec","user":{"login":"mradcliffe","id":328497,"avatar_url":"https://avatars.githubusercontent.com/u/328497?v=3","gravatar_id":"","url":"https://api.github.com/users/mradcliffe","html_url":"https://github.com/mradcliffe","followers_url":"https://api.github.com/users/mradcliffe/followers","following_url":"https://api.github.com/users/mradcliffe/following{/other_user}","gists_url":"https://api.github.com/users/mradcliffe/gists{/gist_id}","starred_url":"https://api.github.com/users/mradcliffe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mradcliffe/subscriptions","organizations_url":"https://api.github.com/users/mradcliffe/orgs","repos_url":"https://api.github.com/users/mradcliffe/repos","events_url":"https://api.github.com/users/mradcliffe/events{/privacy}","received_events_url":"https://api.github.com/users/mradcliffe/received_events","type":"User","site_admin":false},"repo":{"id":39794065,"name":"key","full_name":"mradcliffe/key","owner":{"login":"mradcliffe","id":328497,"avatar_url":"https://avatars.githubusercontent.com/u/328497?v=3","gravatar_id":"","url":"https://api.github.com/users/mradcliffe","html_url":"https://github.com/mradcliffe","followers_url":"https://api.github.com/users/mradcliffe/followers","following_url":"https://api.github.com/users/mradcliffe/following{/other_user}","gists_url":"https://api.github.com/users/mradcliffe/gists{/gist_id}","starred_url":"https://api.github.com/users/mradcliffe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mradcliffe/subscriptions","organizations_url":"https://api.github.com/users/mradcliffe/orgs","repos_url":"https://api.github.com/users/mradcliffe/repos","events_url":"https://api.github.com/users/mradcliffe/events{/privacy}","received_events_url":"https://api.github.com/users/mradcliffe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mradcliffe/key","description":"New Drupal 8 module for supporting system Keys","fork":true,"url":"https://api.github.com/repos/mradcliffe/key","forks_url":"https://api.github.com/repos/mradcliffe/key/forks","keys_url":"https://api.github.com/repos/mradcliffe/key/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mradcliffe/key/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mradcliffe/key/teams","hooks_url":"https://api.github.com/repos/mradcliffe/key/hooks","issue_events_url":"https://api.github.com/repos/mradcliffe/key/issues/events{/number}","events_url":"https://api.github.com/repos/mradcliffe/key/events","assignees_url":"https://api.github.com/repos/mradcliffe/key/assignees{/user}","branches_url":"https://api.github.com/repos/mradcliffe/key/branches{/branch}","tags_url":"https://api.github.com/repos/mradcliffe/key/tags","blobs_url":"https://api.github.com/repos/mradcliffe/key/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mradcliffe/key/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mradcliffe/key/git/refs{/sha}","trees_url":"https://api.github.com/repos/mradcliffe/key/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mradcliffe/key/statuses/{sha}","languages_url":"https://api.github.com/repos/mradcliffe/key/languages","stargazers_url":"https://api.github.com/repos/mradcliffe/key/stargazers","contributors_url":"https://api.github.com/repos/mradcliffe/key/contributors","subscribers_url":"https://api.github.com/repos/mradcliffe/key/subscribers","subscription_url":"https://api.github.com/repos/mradcliffe/key/subscription","commits_url":"https://api.github.com/repos/mradcliffe/key/commits{/sha}","git_commits_url":"https://api.github.com/repos/mradcliffe/key/git/commits{/sha}","comments_url":"https://api.github.com/repos/mradcliffe/key/comments{/number}","issue_comment_url":"https://api.github.com/repos/mradcliffe/key/issues/comments{/number}","contents_url":"https://api.github.com/repos/mradcliffe/key/contents/{+path}","compare_url":"https://api.github.com/repos/mradcliffe/key/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mradcliffe/key/merges","archive_url":"https://api.github.com/repos/mradcliffe/key/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mradcliffe/key/downloads","issues_url":"https://api.github.com/repos/mradcliffe/key/issues{/number}","pulls_url":"https://api.github.com/repos/mradcliffe/key/pulls{/number}","milestones_url":"https://api.github.com/repos/mradcliffe/key/milestones{/number}","notifications_url":"https://api.github.com/repos/mradcliffe/key/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mradcliffe/key/labels{/name}","releases_url":"https://api.github.com/repos/mradcliffe/key/releases{/id}","created_at":"2015-07-27T19:39:39Z","updated_at":"2015-07-27T19:39:39Z","pushed_at":"2015-07-29T15:16:05Z","git_url":"git://github.com/mradcliffe/key.git","ssh_url":"git@github.com:mradcliffe/key.git","clone_url":"https://github.com/mradcliffe/key.git","svn_url":"https://github.com/mradcliffe/key","homepage":null,"size":145,"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":"nerdstein:master","ref":"master","sha":"f73d4cd707c6f6c48dd61e27bf3c726db7a1b007","user":{"login":"nerdstein","id":966547,"avatar_url":"https://avatars.githubusercontent.com/u/966547?v=3","gravatar_id":"","url":"https://api.github.com/users/nerdstein","html_url":"https://github.com/nerdstein","followers_url":"https://api.github.com/users/nerdstein/followers","following_url":"https://api.github.com/users/nerdstein/following{/other_user}","gists_url":"https://api.github.com/users/nerdstein/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdstein/subscriptions","organizations_url":"https://api.github.com/users/nerdstein/orgs","repos_url":"https://api.github.com/users/nerdstein/repos","events_url":"https://api.github.com/users/nerdstein/events{/privacy}","received_events_url":"https://api.github.com/users/nerdstein/received_events","type":"User","site_admin":false},"repo":{"id":38453673,"name":"key","full_name":"nerdstein/key","owner":{"login":"nerdstein","id":966547,"avatar_url":"https://avatars.githubusercontent.com/u/966547?v=3","gravatar_id":"","url":"https://api.github.com/users/nerdstein","html_url":"https://github.com/nerdstein","followers_url":"https://api.github.com/users/nerdstein/followers","following_url":"https://api.github.com/users/nerdstein/following{/other_user}","gists_url":"https://api.github.com/users/nerdstein/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdstein/subscriptions","organizations_url":"https://api.github.com/users/nerdstein/orgs","repos_url":"https://api.github.com/users/nerdstein/repos","events_url":"https://api.github.com/users/nerdstein/events{/privacy}","received_events_url":"https://api.github.com/users/nerdstein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nerdstein/key","description":"New Drupal 8 module for supporting system Keys","fork":false,"url":"https://api.github.com/repos/nerdstein/key","forks_url":"https://api.github.com/repos/nerdstein/key/forks","keys_url":"https://api.github.com/repos/nerdstein/key/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nerdstein/key/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nerdstein/key/teams","hooks_url":"https://api.github.com/repos/nerdstein/key/hooks","issue_events_url":"https://api.github.com/repos/nerdstein/key/issues/events{/number}","events_url":"https://api.github.com/repos/nerdstein/key/events","assignees_url":"https://api.github.com/repos/nerdstein/key/assignees{/user}","branches_url":"https://api.github.com/repos/nerdstein/key/branches{/branch}","tags_url":"https://api.github.com/repos/nerdstein/key/tags","blobs_url":"https://api.github.com/repos/nerdstein/key/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nerdstein/key/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nerdstein/key/git/refs{/sha}","trees_url":"https://api.github.com/repos/nerdstein/key/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nerdstein/key/statuses/{sha}","languages_url":"https://api.github.com/repos/nerdstein/key/languages","stargazers_url":"https://api.github.com/repos/nerdstein/key/stargazers","contributors_url":"https://api.github.com/repos/nerdstein/key/contributors","subscribers_url":"https://api.github.com/repos/nerdstein/key/subscribers","subscription_url":"https://api.github.com/repos/nerdstein/key/subscription","commits_url":"https://api.github.com/repos/nerdstein/key/commits{/sha}","git_commits_url":"https://api.github.com/repos/nerdstein/key/git/commits{/sha}","comments_url":"https://api.github.com/repos/nerdstein/key/comments{/number}","issue_comment_url":"https://api.github.com/repos/nerdstein/key/issues/comments{/number}","contents_url":"https://api.github.com/repos/nerdstein/key/contents/{+path}","compare_url":"https://api.github.com/repos/nerdstein/key/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nerdstein/key/merges","archive_url":"https://api.github.com/repos/nerdstein/key/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nerdstein/key/downloads","issues_url":"https://api.github.com/repos/nerdstein/key/issues{/number}","pulls_url":"https://api.github.com/repos/nerdstein/key/pulls{/number}","milestones_url":"https://api.github.com/repos/nerdstein/key/milestones{/number}","notifications_url":"https://api.github.com/repos/nerdstein/key/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nerdstein/key/labels{/name}","releases_url":"https://api.github.com/repos/nerdstein/key/releases{/id}","created_at":"2015-07-02T19:50:39Z","updated_at":"2015-07-27T19:36:22Z","pushed_at":"2015-07-29T12:32:35Z","git_url":"git://github.com/nerdstein/key.git","ssh_url":"git@github.com:nerdstein/key.git","clone_url":"https://github.com/nerdstein/key.git","svn_url":"https://github.com/nerdstein/key","homepage":null,"size":145,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nerdstein/key/pulls/10"},"html":{"href":"https://github.com/nerdstein/key/pull/10"},"issue":{"href":"https://api.github.com/repos/nerdstein/key/issues/10"},"comments":{"href":"https://api.github.com/repos/nerdstein/key/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/nerdstein/key/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/nerdstein/key/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nerdstein/key/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/nerdstein/key/statuses/62de84ad41b3275db7dbf85867f61528703b4fec"}}}}