{"action":"created","comment":{"url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/comments/230902504","pull_request_review_id":171747808,"id":230902504,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDkwMjUwNA==","diff_hunk":"@@ -0,0 +1,164 @@\n+<?php\n+/**\n+ * Copyright 2018 Google Inc.\n+ *\n+ * This program is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License\n+ * version 2 as published by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program; if not, write to the Free Software\n+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n+ * MA 02110-1301, USA.\n+ */\n+\n+namespace Drupal\\apigee_mock_client;\n+\n+use Apigee\\Edge\\Exception\\ClientErrorException;\n+use Drupal\\Core\\Queue\\QueueFactory;\n+use GuzzleHttp\\Handler\\MockHandler;\n+use GuzzleHttp\\Psr7\\Response;\n+use Psr\\Http\\Message\\RequestInterface;\n+use Psr\\Http\\Message\\ResponseInterface;\n+use Symfony\\Component\\Yaml\\Yaml;\n+\n+class MockHandlerStack extends MockHandler {\n+\n+  /**\n+   * Responses that have been loaded from the response file.\n+   *\n+   * @var array\n+   */\n+  protected $responses;\n+\n+  /**\n+   * The twig environment for getting response data.\n+   *\n+   * @var \\Twig_Environment\n+   */\n+  protected $twig;\n+\n+  /**\n+   * @var \\Drupal\\Core\\Queue\\QueueInterface\n+   */\n+  protected $database_queue;\n+\n+  /**\n+   * @param \\Twig_Environment $twig\n+   * @param \\Drupal\\Core\\Queue\\QueueFactory $queue_factory\n+   */\n+  public function __construct(\\Twig_Environment $twig, QueueFactory $queue_factory) {\n+    $this->twig = $twig;\n+    $this->database_queue = $queue_factory->get('apigee_edge_mock_responses', TRUE);\n+\n+    parent::__construct();\n+  }\n+\n+  /**\n+   * Queue a response that is in the catalog. Dynamic values can be passed and\n+   * will be replaced in the response. For example `['foo' => [':bar' => 'baz']]`\n+   * will load the catalog entry named `foo `and replace `:bar` with \"baz\" in the\n+   * body text.\n+   *\n+   * @param string|array $response_ids\n+   *   The response id to queue in one of the following formats:\n+   *     - `'foo'`\n+   *     - `['foo', 'bar']` // Queue multiple responses.\n+   *     - `['foo' => [':bar' => 'baz']]` // w/ replacements for response body.\n+   *\n+   * @return $this\n+   *\n+   * @throws \\Twig_Error_Loader\n+   * @throws \\Twig_Error_Runtime\n+   * @throws \\Twig_Error_Syntax\n+   */\n+  public function queueFromResponseFile($response_ids) {\n+    $org_name = \\Drupal::service('apigee_edge.sdk_connector')->getOrganization();","path":"tests/modules/apigee_mock_client/src/MockHandlerStack.php","position":81,"original_position":81,"commit_id":"7d37982edb0f00b3cb3e1e90c7b41c981ccf1358","original_commit_id":"7d37982edb0f00b3cb3e1e90c7b41c981ccf1358","user":{"login":"void--","id":7862702,"node_id":"MDQ6VXNlcjc4NjI3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/7862702?v=4","gravatar_id":"","url":"https://api.github.com/users/void--","html_url":"https://github.com/void--","followers_url":"https://api.github.com/users/void--/followers","following_url":"https://api.github.com/users/void--/following{/other_user}","gists_url":"https://api.github.com/users/void--/gists{/gist_id}","starred_url":"https://api.github.com/users/void--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/void--/subscriptions","organizations_url":"https://api.github.com/users/void--/orgs","repos_url":"https://api.github.com/users/void--/repos","events_url":"https://api.github.com/users/void--/events{/privacy}","received_events_url":"https://api.github.com/users/void--/received_events","type":"User","site_admin":false},"body":"We've had some issues with the sdk_connector getting constructed before credentials are available... This might have had something to do with that, but I think it's not the end of the world to leave it for now either way.","created_at":"2018-11-05T20:36:58Z","updated_at":"2018-11-05T20:36:59Z","html_url":"https://github.com/apigee/apigee-edge-drupal/pull/79#discussion_r230902504","pull_request_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/comments/230902504"},"html":{"href":"https://github.com/apigee/apigee-edge-drupal/pull/79#discussion_r230902504"},"pull_request":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79"}},"in_reply_to_id":229189469},"pull_request":{"url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79","id":224770747,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NzcwNzQ3","html_url":"https://github.com/apigee/apigee-edge-drupal/pull/79","diff_url":"https://github.com/apigee/apigee-edge-drupal/pull/79.diff","patch_url":"https://github.com/apigee/apigee-edge-drupal/pull/79.patch","issue_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues/79","number":79,"state":"open","locked":false,"title":"Move mock client testing sub-module from Monetization to Edge","user":{"login":"void--","id":7862702,"node_id":"MDQ6VXNlcjc4NjI3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/7862702?v=4","gravatar_id":"","url":"https://api.github.com/users/void--","html_url":"https://github.com/void--","followers_url":"https://api.github.com/users/void--/followers","following_url":"https://api.github.com/users/void--/following{/other_user}","gists_url":"https://api.github.com/users/void--/gists{/gist_id}","starred_url":"https://api.github.com/users/void--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/void--/subscriptions","organizations_url":"https://api.github.com/users/void--/orgs","repos_url":"https://api.github.com/users/void--/repos","events_url":"https://api.github.com/users/void--/events{/privacy}","received_events_url":"https://api.github.com/users/void--/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-22T18:31:01Z","updated_at":"2018-11-05T20:36:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04a1f3bdd94f1690087fc5c5ea47113203d4d0d6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79/commits","review_comments_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79/comments","review_comment_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues/79/comments","statuses_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/statuses/7d37982edb0f00b3cb3e1e90c7b41c981ccf1358","head":{"label":"void--:8.x-1.x","ref":"8.x-1.x","sha":"7d37982edb0f00b3cb3e1e90c7b41c981ccf1358","user":{"login":"void--","id":7862702,"node_id":"MDQ6VXNlcjc4NjI3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/7862702?v=4","gravatar_id":"","url":"https://api.github.com/users/void--","html_url":"https://github.com/void--","followers_url":"https://api.github.com/users/void--/followers","following_url":"https://api.github.com/users/void--/following{/other_user}","gists_url":"https://api.github.com/users/void--/gists{/gist_id}","starred_url":"https://api.github.com/users/void--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/void--/subscriptions","organizations_url":"https://api.github.com/users/void--/orgs","repos_url":"https://api.github.com/users/void--/repos","events_url":"https://api.github.com/users/void--/events{/privacy}","received_events_url":"https://api.github.com/users/void--/received_events","type":"User","site_admin":false},"repo":{"id":153706500,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM3MDY1MDA=","name":"apigee-edge-drupal","full_name":"void--/apigee-edge-drupal","private":false,"owner":{"login":"void--","id":7862702,"node_id":"MDQ6VXNlcjc4NjI3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/7862702?v=4","gravatar_id":"","url":"https://api.github.com/users/void--","html_url":"https://github.com/void--","followers_url":"https://api.github.com/users/void--/followers","following_url":"https://api.github.com/users/void--/following{/other_user}","gists_url":"https://api.github.com/users/void--/gists{/gist_id}","starred_url":"https://api.github.com/users/void--/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/void--/subscriptions","organizations_url":"https://api.github.com/users/void--/orgs","repos_url":"https://api.github.com/users/void--/repos","events_url":"https://api.github.com/users/void--/events{/privacy}","received_events_url":"https://api.github.com/users/void--/received_events","type":"User","site_admin":false},"html_url":"https://github.com/void--/apigee-edge-drupal","description":"The Apigee Edge module enables you to integrate a Drupal 8 with Apigee Edge.","fork":true,"url":"https://api.github.com/repos/void--/apigee-edge-drupal","forks_url":"https://api.github.com/repos/void--/apigee-edge-drupal/forks","keys_url":"https://api.github.com/repos/void--/apigee-edge-drupal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/void--/apigee-edge-drupal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/void--/apigee-edge-drupal/teams","hooks_url":"https://api.github.com/repos/void--/apigee-edge-drupal/hooks","issue_events_url":"https://api.github.com/repos/void--/apigee-edge-drupal/issues/events{/number}","events_url":"https://api.github.com/repos/void--/apigee-edge-drupal/events","assignees_url":"https://api.github.com/repos/void--/apigee-edge-drupal/assignees{/user}","branches_url":"https://api.github.com/repos/void--/apigee-edge-drupal/branches{/branch}","tags_url":"https://api.github.com/repos/void--/apigee-edge-drupal/tags","blobs_url":"https://api.github.com/repos/void--/apigee-edge-drupal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/void--/apigee-edge-drupal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/void--/apigee-edge-drupal/git/refs{/sha}","trees_url":"https://api.github.com/repos/void--/apigee-edge-drupal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/void--/apigee-edge-drupal/statuses/{sha}","languages_url":"https://api.github.com/repos/void--/apigee-edge-drupal/languages","stargazers_url":"https://api.github.com/repos/void--/apigee-edge-drupal/stargazers","contributors_url":"https://api.github.com/repos/void--/apigee-edge-drupal/contributors","subscribers_url":"https://api.github.com/repos/void--/apigee-edge-drupal/subscribers","subscription_url":"https://api.github.com/repos/void--/apigee-edge-drupal/subscription","commits_url":"https://api.github.com/repos/void--/apigee-edge-drupal/commits{/sha}","git_commits_url":"https://api.github.com/repos/void--/apigee-edge-drupal/git/commits{/sha}","comments_url":"https://api.github.com/repos/void--/apigee-edge-drupal/comments{/number}","issue_comment_url":"https://api.github.com/repos/void--/apigee-edge-drupal/issues/comments{/number}","contents_url":"https://api.github.com/repos/void--/apigee-edge-drupal/contents/{+path}","compare_url":"https://api.github.com/repos/void--/apigee-edge-drupal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/void--/apigee-edge-drupal/merges","archive_url":"https://api.github.com/repos/void--/apigee-edge-drupal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/void--/apigee-edge-drupal/downloads","issues_url":"https://api.github.com/repos/void--/apigee-edge-drupal/issues{/number}","pulls_url":"https://api.github.com/repos/void--/apigee-edge-drupal/pulls{/number}","milestones_url":"https://api.github.com/repos/void--/apigee-edge-drupal/milestones{/number}","notifications_url":"https://api.github.com/repos/void--/apigee-edge-drupal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/void--/apigee-edge-drupal/labels{/name}","releases_url":"https://api.github.com/repos/void--/apigee-edge-drupal/releases{/id}","deployments_url":"https://api.github.com/repos/void--/apigee-edge-drupal/deployments","created_at":"2018-10-19T00:57:17Z","updated_at":"2018-10-22T18:29:06Z","pushed_at":"2018-10-29T16:59:37Z","git_url":"git://github.com/void--/apigee-edge-drupal.git","ssh_url":"git@github.com:void--/apigee-edge-drupal.git","clone_url":"https://github.com/void--/apigee-edge-drupal.git","svn_url":"https://github.com/void--/apigee-edge-drupal","homepage":"","size":1688,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.x-1.x"}},"base":{"label":"apigee:8.x-1.x","ref":"8.x-1.x","sha":"ec0734043de096244c31070ed7a4583304b2abf6","user":{"login":"apigee","id":19557821,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTU3ODIx","avatar_url":"https://avatars0.githubusercontent.com/u/19557821?v=4","gravatar_id":"","url":"https://api.github.com/users/apigee","html_url":"https://github.com/apigee","followers_url":"https://api.github.com/users/apigee/followers","following_url":"https://api.github.com/users/apigee/following{/other_user}","gists_url":"https://api.github.com/users/apigee/gists{/gist_id}","starred_url":"https://api.github.com/users/apigee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apigee/subscriptions","organizations_url":"https://api.github.com/users/apigee/orgs","repos_url":"https://api.github.com/users/apigee/repos","events_url":"https://api.github.com/users/apigee/events{/privacy}","received_events_url":"https://api.github.com/users/apigee/received_events","type":"Organization","site_admin":false},"repo":{"id":130411545,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0MTE1NDU=","name":"apigee-edge-drupal","full_name":"apigee/apigee-edge-drupal","private":false,"owner":{"login":"apigee","id":19557821,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTU3ODIx","avatar_url":"https://avatars0.githubusercontent.com/u/19557821?v=4","gravatar_id":"","url":"https://api.github.com/users/apigee","html_url":"https://github.com/apigee","followers_url":"https://api.github.com/users/apigee/followers","following_url":"https://api.github.com/users/apigee/following{/other_user}","gists_url":"https://api.github.com/users/apigee/gists{/gist_id}","starred_url":"https://api.github.com/users/apigee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apigee/subscriptions","organizations_url":"https://api.github.com/users/apigee/orgs","repos_url":"https://api.github.com/users/apigee/repos","events_url":"https://api.github.com/users/apigee/events{/privacy}","received_events_url":"https://api.github.com/users/apigee/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apigee/apigee-edge-drupal","description":"The Apigee Edge module enables you to integrate a Drupal 8 with Apigee Edge.","fork":false,"url":"https://api.github.com/repos/apigee/apigee-edge-drupal","forks_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/forks","keys_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/teams","hooks_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/hooks","issue_events_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues/events{/number}","events_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/events","assignees_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/assignees{/user}","branches_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/branches{/branch}","tags_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/tags","blobs_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/git/refs{/sha}","trees_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/statuses/{sha}","languages_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/languages","stargazers_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/stargazers","contributors_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/contributors","subscribers_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/subscribers","subscription_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/subscription","commits_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/commits{/sha}","git_commits_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/git/commits{/sha}","comments_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/comments{/number}","issue_comment_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues/comments{/number}","contents_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/contents/{+path}","compare_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/merges","archive_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/downloads","issues_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues{/number}","pulls_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls{/number}","milestones_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/milestones{/number}","notifications_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/labels{/name}","releases_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/releases{/id}","deployments_url":"https://api.github.com/repos/apigee/apigee-edge-drupal/deployments","created_at":"2018-04-20T20:36:23Z","updated_at":"2018-10-19T15:52:05Z","pushed_at":"2018-11-05T19:25:26Z","git_url":"git://github.com/apigee/apigee-edge-drupal.git","ssh_url":"git@github.com:apigee/apigee-edge-drupal.git","clone_url":"https://github.com/apigee/apigee-edge-drupal.git","svn_url":"https://github.com/apigee/apigee-edge-drupal","homepage":"https://www.drupal.org/project/apigee_edge","size":1728,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":9,"open_issues":7,"watchers":3,"default_branch":"8.x-1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79"},"html":{"href":"https://github.com/apigee/apigee-edge-drupal/pull/79"},"issue":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues/79"},"comments":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/apigee/apigee-edge-drupal/statuses/7d37982edb0f00b3cb3e1e90c7b41c981ccf1358"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"void--"}}