{"action":"created","issue":{"url":"https://api.github.com/repos/nerdstein/key/issues/10","labels_url":"https://api.github.com/repos/nerdstein/key/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/nerdstein/key/issues/10/comments","events_url":"https://api.github.com/repos/nerdstein/key/issues/10/events","html_url":"https://github.com/nerdstein/key/pull/10","id":97591920,"number":10,"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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-28T01:23:13Z","updated_at":"2015-07-29T18:09:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nerdstein/key/pulls/10","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"},"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```"},"comment":{"url":"https://api.github.com/repos/nerdstein/key/issues/comments/126044859","html_url":"https://github.com/nerdstein/key/pull/10#issuecomment-126044859","issue_url":"https://api.github.com/repos/nerdstein/key/issues/10","id":126044859,"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},"created_at":"2015-07-29T18:09:40Z","updated_at":"2015-07-29T18:09:40Z","body":"1. **Re: Readme.md**\r\n   * I added some links to explanations about how to leverage dependency injection in Drupal 8 to the readme.md file in a prior commit, and I think that is sufficient.\r\n2. **Re: Composer.json**\r\n   * We don't need to include phpunit in composer.json because Drupal already includes it as part of core. Furthermore apparently the drupal-ti test runner also includes phpunit.\r\n3. **Re: Travis**\r\n   * I just merged a commit to change to using [drupal-ti](https://github.com/LionsAd/drupal_ti/), which identified #13 and I fixed that. Here's the build for that commit: https://travis-ci.org/mradcliffe/key/builds/73238879. It's a failed build because of the bugs I wrote tests for that are still open.\r\n   * The next step after this PR would be to create an open source [Travis CI](http://www.travis-ci.org) account and associate this repository with it."}}