{"action":"created","comment":{"url":"https://api.github.com/repos/php-http/discovery/pulls/comments/98275456","pull_request_review_id":18915407,"id":98275456,"diff_hunk":"@@ -0,0 +1,26 @@\n+<?php\n+\n+namespace Http\\Discovery\\Strategy;\n+\n+use Http\\Mock\\Client as Mock;\n+\n+/**\n+ * Find the Mock client.\n+ *\n+ * @internal\n+ * @final\n+ *\n+ * @author Sam Rapaport <me@samrapdev.com>\n+ */\n+final class MockClientStrategy implements DiscoveryStrategy\n+{\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public static function getCandidates($type)\n+    {\n+        return ($type === 'Http\\Client\\HttpClient')","path":"src/Strategy/MockClientStrategy.php","position":22,"original_position":22,"commit_id":"fdf8bade547cd9b5cecf760dcfd1dc5d8bcc7d5a","original_commit_id":"fdf8bade547cd9b5cecf760dcfd1dc5d8bcc7d5a","user":{"login":"samrap","id":5227553,"avatar_url":"https://avatars.githubusercontent.com/u/5227553?v=3","gravatar_id":"","url":"https://api.github.com/users/samrap","html_url":"https://github.com/samrap","followers_url":"https://api.github.com/users/samrap/followers","following_url":"https://api.github.com/users/samrap/following{/other_user}","gists_url":"https://api.github.com/users/samrap/gists{/gist_id}","starred_url":"https://api.github.com/users/samrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samrap/subscriptions","organizations_url":"https://api.github.com/users/samrap/orgs","repos_url":"https://api.github.com/users/samrap/repos","events_url":"https://api.github.com/users/samrap/events{/privacy}","received_events_url":"https://api.github.com/users/samrap/received_events","type":"User","site_admin":false},"body":"Good call, changing that now.","created_at":"2017-01-27T19:40:47Z","updated_at":"2017-01-27T19:40:47Z","html_url":"https://github.com/php-http/discovery/pull/90#discussion_r98275456","pull_request_url":"https://api.github.com/repos/php-http/discovery/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/php-http/discovery/pulls/comments/98275456"},"html":{"href":"https://github.com/php-http/discovery/pull/90#discussion_r98275456"},"pull_request":{"href":"https://api.github.com/repos/php-http/discovery/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/php-http/discovery/pulls/90","id":103449431,"html_url":"https://github.com/php-http/discovery/pull/90","diff_url":"https://github.com/php-http/discovery/pull/90.diff","patch_url":"https://github.com/php-http/discovery/pull/90.patch","issue_url":"https://api.github.com/repos/php-http/discovery/issues/90","number":90,"state":"open","locked":false,"title":"Add Mock Client strategy.","user":{"login":"samrap","id":5227553,"avatar_url":"https://avatars.githubusercontent.com/u/5227553?v=3","gravatar_id":"","url":"https://api.github.com/users/samrap","html_url":"https://github.com/samrap","followers_url":"https://api.github.com/users/samrap/followers","following_url":"https://api.github.com/users/samrap/following{/other_user}","gists_url":"https://api.github.com/users/samrap/gists{/gist_id}","starred_url":"https://api.github.com/users/samrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samrap/subscriptions","organizations_url":"https://api.github.com/users/samrap/orgs","repos_url":"https://api.github.com/users/samrap/repos","events_url":"https://api.github.com/users/samrap/events{/privacy}","received_events_url":"https://api.github.com/users/samrap/received_events","type":"User","site_admin":false},"body":"| Q               | A\r\n| --------------- | ---\r\n| Bug fix?        | no|\r\n| New feature?    |yes|\r\n| BC breaks?      | no|\r\n| Deprecations?   | no|\r\n| Related tickets | mentioned in #89 \r\n| Documentation   | Awaiting approval\r\n| License         | MIT\r\n\r\n\r\n#### What's in this PR?\r\n\r\nPlease see #89 for a full description of this PR.\r\n\r\nEssentially, we need a way to test DI within our tests which in many cases cannot be fully implemented without having some way to discover the Mock Client. This new class allows us to add the `MockClientStrategy` to the `HttpClientDiscovery`'s strategies as shown in @Nyholm 's example in the above mentioned PR.\r\n\r\n#### Example Usage\r\n\r\n``` php\r\nuse ThirdPartyService\r\n\r\nclass ThirdPartyServiceTest extends PHPUnit_Framework_TestCase\r\n{\r\n    public function setUpBeforeClass()\r\n    {\r\n        HttpClientDiscovery::prependStrategy(MockClientStrategy::class);\r\n    }\r\n\r\n    public function setUp()\r\n    {\r\n        $this->service = new ThirdPartyService;\r\n    }\r\n}\r\n```\r\n\r\n\r\n#### Checklist\r\n\r\n- [x] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix\r\n- [ ] Documentation pull request created (if not simply a bugfix)\r\n","created_at":"2017-01-27T07:43:18Z","updated_at":"2017-01-27T19:40:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb10f3959b8acada51da50eb5d8e4342fa400904","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/php-http/discovery/pulls/90/commits","review_comments_url":"https://api.github.com/repos/php-http/discovery/pulls/90/comments","review_comment_url":"https://api.github.com/repos/php-http/discovery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-http/discovery/issues/90/comments","statuses_url":"https://api.github.com/repos/php-http/discovery/statuses/fdf8bade547cd9b5cecf760dcfd1dc5d8bcc7d5a","head":{"label":"samrap:mock-discovery-strategy","ref":"mock-discovery-strategy","sha":"fdf8bade547cd9b5cecf760dcfd1dc5d8bcc7d5a","user":{"login":"samrap","id":5227553,"avatar_url":"https://avatars.githubusercontent.com/u/5227553?v=3","gravatar_id":"","url":"https://api.github.com/users/samrap","html_url":"https://github.com/samrap","followers_url":"https://api.github.com/users/samrap/followers","following_url":"https://api.github.com/users/samrap/following{/other_user}","gists_url":"https://api.github.com/users/samrap/gists{/gist_id}","starred_url":"https://api.github.com/users/samrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samrap/subscriptions","organizations_url":"https://api.github.com/users/samrap/orgs","repos_url":"https://api.github.com/users/samrap/repos","events_url":"https://api.github.com/users/samrap/events{/privacy}","received_events_url":"https://api.github.com/users/samrap/received_events","type":"User","site_admin":false},"repo":{"id":78893812,"name":"discovery","full_name":"samrap/discovery","owner":{"login":"samrap","id":5227553,"avatar_url":"https://avatars.githubusercontent.com/u/5227553?v=3","gravatar_id":"","url":"https://api.github.com/users/samrap","html_url":"https://github.com/samrap","followers_url":"https://api.github.com/users/samrap/followers","following_url":"https://api.github.com/users/samrap/following{/other_user}","gists_url":"https://api.github.com/users/samrap/gists{/gist_id}","starred_url":"https://api.github.com/users/samrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samrap/subscriptions","organizations_url":"https://api.github.com/users/samrap/orgs","repos_url":"https://api.github.com/users/samrap/repos","events_url":"https://api.github.com/users/samrap/events{/privacy}","received_events_url":"https://api.github.com/users/samrap/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samrap/discovery","description":"Finds installed clients and message factories","fork":true,"url":"https://api.github.com/repos/samrap/discovery","forks_url":"https://api.github.com/repos/samrap/discovery/forks","keys_url":"https://api.github.com/repos/samrap/discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samrap/discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samrap/discovery/teams","hooks_url":"https://api.github.com/repos/samrap/discovery/hooks","issue_events_url":"https://api.github.com/repos/samrap/discovery/issues/events{/number}","events_url":"https://api.github.com/repos/samrap/discovery/events","assignees_url":"https://api.github.com/repos/samrap/discovery/assignees{/user}","branches_url":"https://api.github.com/repos/samrap/discovery/branches{/branch}","tags_url":"https://api.github.com/repos/samrap/discovery/tags","blobs_url":"https://api.github.com/repos/samrap/discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samrap/discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samrap/discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/samrap/discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samrap/discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/samrap/discovery/languages","stargazers_url":"https://api.github.com/repos/samrap/discovery/stargazers","contributors_url":"https://api.github.com/repos/samrap/discovery/contributors","subscribers_url":"https://api.github.com/repos/samrap/discovery/subscribers","subscription_url":"https://api.github.com/repos/samrap/discovery/subscription","commits_url":"https://api.github.com/repos/samrap/discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/samrap/discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/samrap/discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/samrap/discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/samrap/discovery/contents/{+path}","compare_url":"https://api.github.com/repos/samrap/discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samrap/discovery/merges","archive_url":"https://api.github.com/repos/samrap/discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samrap/discovery/downloads","issues_url":"https://api.github.com/repos/samrap/discovery/issues{/number}","pulls_url":"https://api.github.com/repos/samrap/discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/samrap/discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/samrap/discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samrap/discovery/labels{/name}","releases_url":"https://api.github.com/repos/samrap/discovery/releases{/id}","deployments_url":"https://api.github.com/repos/samrap/discovery/deployments","created_at":"2017-01-13T23:07:38Z","updated_at":"2017-01-13T23:07:40Z","pushed_at":"2017-01-27T07:36:34Z","git_url":"git://github.com/samrap/discovery.git","ssh_url":"git@github.com:samrap/discovery.git","clone_url":"https://github.com/samrap/discovery.git","svn_url":"https://github.com/samrap/discovery","homepage":"http://php-http.org","size":491,"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":"php-http:master","ref":"master","sha":"2659ac1816c24a4a4dd7e224e0ffc7e6065b0ed8","user":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":36755218,"name":"discovery","full_name":"php-http/discovery","owner":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-http/discovery","description":"Finds installed clients and message factories","fork":false,"url":"https://api.github.com/repos/php-http/discovery","forks_url":"https://api.github.com/repos/php-http/discovery/forks","keys_url":"https://api.github.com/repos/php-http/discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/discovery/teams","hooks_url":"https://api.github.com/repos/php-http/discovery/hooks","issue_events_url":"https://api.github.com/repos/php-http/discovery/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/discovery/events","assignees_url":"https://api.github.com/repos/php-http/discovery/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/discovery/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/discovery/tags","blobs_url":"https://api.github.com/repos/php-http/discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/discovery/languages","stargazers_url":"https://api.github.com/repos/php-http/discovery/stargazers","contributors_url":"https://api.github.com/repos/php-http/discovery/contributors","subscribers_url":"https://api.github.com/repos/php-http/discovery/subscribers","subscription_url":"https://api.github.com/repos/php-http/discovery/subscription","commits_url":"https://api.github.com/repos/php-http/discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/discovery/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/discovery/merges","archive_url":"https://api.github.com/repos/php-http/discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/discovery/downloads","issues_url":"https://api.github.com/repos/php-http/discovery/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/discovery/labels{/name}","releases_url":"https://api.github.com/repos/php-http/discovery/releases{/id}","deployments_url":"https://api.github.com/repos/php-http/discovery/deployments","created_at":"2015-06-02T19:03:26Z","updated_at":"2016-11-27T12:55:27Z","pushed_at":"2017-01-27T07:43:19Z","git_url":"git://github.com/php-http/discovery.git","ssh_url":"git@github.com:php-http/discovery.git","clone_url":"https://github.com/php-http/discovery.git","svn_url":"https://github.com/php-http/discovery","homepage":"http://php-http.org","size":572,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-http/discovery/pulls/90"},"html":{"href":"https://github.com/php-http/discovery/pull/90"},"issue":{"href":"https://api.github.com/repos/php-http/discovery/issues/90"},"comments":{"href":"https://api.github.com/repos/php-http/discovery/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/php-http/discovery/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/php-http/discovery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-http/discovery/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/php-http/discovery/statuses/fdf8bade547cd9b5cecf760dcfd1dc5d8bcc7d5a"}}}}
{"actor":{"display_login":"samrap"}}