diff --git a/composer.json b/composer.json index 8eeb579..c63695d 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "sensio/framework-extra-bundle": "^3.0.2", "incenteev/composer-parameter-handler": "^2.0", "knplabs/github-api": "^1.7", - "lp-digital/github-event-parser": "~0.7" + "lp-digital/github-event-parser": "~0.8" }, "require-dev": { "phpunit/phpunit": "5.4.*", diff --git a/composer.lock b/composer.lock index 6ec4581..f75cce6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "7c7a04b8934a8797756c2e7bb7bb7e45", - "content-hash": "b5d9806d42f356e7690795c14f1075f5", + "hash": "2238266c41b0600f58b7044678e0ab33", + "content-hash": "a906e3d58b6ea0d0da9657b94ecb27c4", "packages": [ { "name": "doctrine/annotations", @@ -1033,16 +1033,16 @@ }, { "name": "lp-digital/github-event-parser", - "version": "v0.7.8.1", + "version": "v0.8", "source": { "type": "git", "url": "https://github.com/Lp-digital/github-event-parser.git", - "reference": "ce6bd12163d63571220717ac074b3a8b08d2ab4a" + "reference": "e4be022b1831e774cd4a1e08dc1c0f3eba8a1929" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Lp-digital/github-event-parser/zipball/ce6bd12163d63571220717ac074b3a8b08d2ab4a", - "reference": "ce6bd12163d63571220717ac074b3a8b08d2ab4a", + "url": "https://api.github.com/repos/Lp-digital/github-event-parser/zipball/e4be022b1831e774cd4a1e08dc1c0f3eba8a1929", + "reference": "e4be022b1831e774cd4a1e08dc1c0f3eba8a1929", "shasum": "" }, "require": { @@ -1080,7 +1080,7 @@ "github", "json parser" ], - "time": "2016-11-03 15:49:01" + "time": "2016-11-24 13:13:09" }, { "name": "monolog/monolog", @@ -1461,16 +1461,16 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.3", + "version": "v5.4.4", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153" + "reference": "545ce9136690cea74f98f86fbb9c92dd9ab1a756" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", - "reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/545ce9136690cea74f98f86fbb9c92dd9ab1a756", + "reference": "545ce9136690cea74f98f86fbb9c92dd9ab1a756", "shasum": "" }, "require": { @@ -1510,7 +1510,7 @@ "mail", "mailer" ], - "time": "2016-07-08 11:51:25" + "time": "2016-11-24 01:01:23" }, { "name": "symfony/monolog-bundle", @@ -2112,16 +2112,16 @@ }, { "name": "twig/twig", - "version": "v1.28.1", + "version": "v1.28.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "fff80c4a7ae1d47a81dfec10c76cbcb939170b45" + "reference": "b22ce0eb070e41f7cba65d78fe216de29726459c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/fff80c4a7ae1d47a81dfec10c76cbcb939170b45", - "reference": "fff80c4a7ae1d47a81dfec10c76cbcb939170b45", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/b22ce0eb070e41f7cba65d78fe216de29726459c", + "reference": "b22ce0eb070e41f7cba65d78fe216de29726459c", "shasum": "" }, "require": { @@ -2129,7 +2129,7 @@ }, "require-dev": { "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" + "symfony/phpunit-bridge": "~3.2@dev" }, "type": "library", "extra": { @@ -2169,7 +2169,7 @@ "keywords": [ "templating" ], - "time": "2016-11-19 05:52:49" + "time": "2016-11-23 18:41:40" } ], "packages-dev": [ @@ -3429,20 +3429,20 @@ }, { "name": "webmozart/assert", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", - "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", "shasum": "" }, "require": { - "php": "^5.3.3|^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -3451,7 +3451,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -3475,7 +3475,7 @@ "check", "validate" ], - "time": "2016-08-09 15:02:57" + "time": "2016-11-23 20:04:58" } ], "aliases": [], diff --git a/tests/AppBundle/Controller/WebhookControllerTest.php b/tests/AppBundle/Controller/WebhookControllerTest.php index f4541c3..e6dc82c 100644 --- a/tests/AppBundle/Controller/WebhookControllerTest.php +++ b/tests/AppBundle/Controller/WebhookControllerTest.php @@ -124,6 +124,11 @@ public function getTests() 'wrong_repository.pull_request.json', [], ]; + $tests['Status'] = [ + 'pull_request', + 'status.json', + [], + ]; $tests['Pull request synchronize'] = [ 'pull_request', 'pull_request.synchronize.json', diff --git a/tests/AppBundle/webhook_examples/status.json b/tests/AppBundle/webhook_examples/status.json new file mode 100644 index 0000000..0d95346 --- /dev/null +++ b/tests/AppBundle/webhook_examples/status.json @@ -0,0 +1,204 @@ +{ + "id": 874981546, + "sha": "c4df002569fff5a4711d4ac38e76db81a94866d0", + "name": "PrestaShop/PrestaShop", + "target_url": "https://travis-ci.org/PrestaShop/PrestaShop/builds/178532369", + "context": "continuous-integration/travis-ci/pr", + "description": "The Travis CI build passed", + "state": "success", + "commit": { + "sha": "c4df002569fff5a4711d4ac38e76db81a94866d0", + "commit": { + "author": { + "name": "Thomas Nabord", + "email": "thomas.nabord@prestashop.com", + "date": "2016-11-23T15:45:15Z" + }, + "committer": { + "name": "Thomas Nabord", + "email": "thomas.nabord@prestashop.com", + "date": "2016-11-23T15:45:15Z" + }, + "message": "IN: Bring back cookie standalone mode", + "tree": { + "sha": "beb506156f548a1a44a42c902ce284d2ba6de6fd", + "url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/trees/beb506156f548a1a44a42c902ce284d2ba6de6fd" + }, + "url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/commits/c4df002569fff5a4711d4ac38e76db81a94866d0", + "comment_count": 0 + }, + "url": "https://api.github.com/repos/PrestaShop/PrestaShop/commits/c4df002569fff5a4711d4ac38e76db81a94866d0", + "html_url": "https://github.com/PrestaShop/PrestaShop/commit/c4df002569fff5a4711d4ac38e76db81a94866d0", + "comments_url": "https://api.github.com/repos/PrestaShop/PrestaShop/commits/c4df002569fff5a4711d4ac38e76db81a94866d0/comments", + "author": { + "login": "Quetzacoalt91", + "id": 6768917, + "avatar_url": "https://avatars.githubusercontent.com/u/6768917?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/Quetzacoalt91", + "html_url": "https://github.com/Quetzacoalt91", + "followers_url": "https://api.github.com/users/Quetzacoalt91/followers", + "following_url": "https://api.github.com/users/Quetzacoalt91/following{/other_user}", + "gists_url": "https://api.github.com/users/Quetzacoalt91/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Quetzacoalt91/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Quetzacoalt91/subscriptions", + "organizations_url": "https://api.github.com/users/Quetzacoalt91/orgs", + "repos_url": "https://api.github.com/users/Quetzacoalt91/repos", + "events_url": "https://api.github.com/users/Quetzacoalt91/events{/privacy}", + "received_events_url": "https://api.github.com/users/Quetzacoalt91/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "Quetzacoalt91", + "id": 6768917, + "avatar_url": "https://avatars.githubusercontent.com/u/6768917?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/Quetzacoalt91", + "html_url": "https://github.com/Quetzacoalt91", + "followers_url": "https://api.github.com/users/Quetzacoalt91/followers", + "following_url": "https://api.github.com/users/Quetzacoalt91/following{/other_user}", + "gists_url": "https://api.github.com/users/Quetzacoalt91/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Quetzacoalt91/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Quetzacoalt91/subscriptions", + "organizations_url": "https://api.github.com/users/Quetzacoalt91/orgs", + "repos_url": "https://api.github.com/users/Quetzacoalt91/repos", + "events_url": "https://api.github.com/users/Quetzacoalt91/events{/privacy}", + "received_events_url": "https://api.github.com/users/Quetzacoalt91/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "dff9a9833c96a9141401d3c6a2191a0ebdca9812", + "url": "https://api.github.com/repos/PrestaShop/PrestaShop/commits/dff9a9833c96a9141401d3c6a2191a0ebdca9812", + "html_url": "https://github.com/PrestaShop/PrestaShop/commit/dff9a9833c96a9141401d3c6a2191a0ebdca9812" + } + ] + }, + "branches": [ + + ], + "created_at": "2016-11-24T09:06:28Z", + "updated_at": "2016-11-24T09:06:28Z", + "repository": { + "id": 6763587, + "name": "PrestaShop", + "full_name": "loveOSS/test", + "owner": { + "login": "PrestaShop", + "id": 2815696, + "avatar_url": "https://avatars.githubusercontent.com/u/2815696?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/PrestaShop", + "html_url": "https://github.com/PrestaShop", + "followers_url": "https://api.github.com/users/PrestaShop/followers", + "following_url": "https://api.github.com/users/PrestaShop/following{/other_user}", + "gists_url": "https://api.github.com/users/PrestaShop/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PrestaShop/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PrestaShop/subscriptions", + "organizations_url": "https://api.github.com/users/PrestaShop/orgs", + "repos_url": "https://api.github.com/users/PrestaShop/repos", + "events_url": "https://api.github.com/users/PrestaShop/events{/privacy}", + "received_events_url": "https://api.github.com/users/PrestaShop/received_events", + "type": "Organization", + "site_admin": false + }, + "private": false, + "html_url": "https://github.com/PrestaShop/PrestaShop", + "description": "PrestaShop offers a free, fully scalable, Open Source e-commerce solution.", + "fork": false, + "url": "https://api.github.com/repos/PrestaShop/PrestaShop", + "forks_url": "https://api.github.com/repos/PrestaShop/PrestaShop/forks", + "keys_url": "https://api.github.com/repos/PrestaShop/PrestaShop/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/PrestaShop/PrestaShop/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/PrestaShop/PrestaShop/teams", + "hooks_url": "https://api.github.com/repos/PrestaShop/PrestaShop/hooks", + "issue_events_url": "https://api.github.com/repos/PrestaShop/PrestaShop/issues/events{/number}", + "events_url": "https://api.github.com/repos/PrestaShop/PrestaShop/events", + "assignees_url": "https://api.github.com/repos/PrestaShop/PrestaShop/assignees{/user}", + "branches_url": "https://api.github.com/repos/PrestaShop/PrestaShop/branches{/branch}", + "tags_url": "https://api.github.com/repos/PrestaShop/PrestaShop/tags", + "blobs_url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/PrestaShop/PrestaShop/statuses/{sha}", + "languages_url": "https://api.github.com/repos/PrestaShop/PrestaShop/languages", + "stargazers_url": "https://api.github.com/repos/PrestaShop/PrestaShop/stargazers", + "contributors_url": "https://api.github.com/repos/PrestaShop/PrestaShop/contributors", + "subscribers_url": "https://api.github.com/repos/PrestaShop/PrestaShop/subscribers", + "subscription_url": "https://api.github.com/repos/PrestaShop/PrestaShop/subscription", + "commits_url": "https://api.github.com/repos/PrestaShop/PrestaShop/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/PrestaShop/PrestaShop/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/PrestaShop/PrestaShop/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/PrestaShop/PrestaShop/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/PrestaShop/PrestaShop/contents/{+path}", + "compare_url": "https://api.github.com/repos/PrestaShop/PrestaShop/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/PrestaShop/PrestaShop/merges", + "archive_url": "https://api.github.com/repos/PrestaShop/PrestaShop/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/PrestaShop/PrestaShop/downloads", + "issues_url": "https://api.github.com/repos/PrestaShop/PrestaShop/issues{/number}", + "pulls_url": "https://api.github.com/repos/PrestaShop/PrestaShop/pulls{/number}", + "milestones_url": "https://api.github.com/repos/PrestaShop/PrestaShop/milestones{/number}", + "notifications_url": "https://api.github.com/repos/PrestaShop/PrestaShop/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/PrestaShop/PrestaShop/labels{/name}", + "releases_url": "https://api.github.com/repos/PrestaShop/PrestaShop/releases{/id}", + "deployments_url": "https://api.github.com/repos/PrestaShop/PrestaShop/deployments", + "created_at": "2012-11-19T16:41:31Z", + "updated_at": "2016-11-22T17:39:13Z", + "pushed_at": "2016-11-24T08:53:34Z", + "git_url": "git://github.com/PrestaShop/PrestaShop.git", + "ssh_url": "git@github.com:PrestaShop/PrestaShop.git", + "clone_url": "https://github.com/PrestaShop/PrestaShop.git", + "svn_url": "https://github.com/PrestaShop/PrestaShop", + "homepage": "http://www.prestashop.com/", + "size": 346905, + "stargazers_count": 2124, + "watchers_count": 2124, + "language": "PHP", + "has_issues": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "forks_count": 2092, + "mirror_url": null, + "open_issues_count": 371, + "forks": 2092, + "open_issues": 371, + "watchers": 2124, + "default_branch": "develop" + }, + "organization": { + "login": "PrestaShop", + "id": 2815696, + "url": "https://api.github.com/orgs/PrestaShop", + "repos_url": "https://api.github.com/orgs/PrestaShop/repos", + "events_url": "https://api.github.com/orgs/PrestaShop/events", + "hooks_url": "https://api.github.com/orgs/PrestaShop/hooks", + "issues_url": "https://api.github.com/orgs/PrestaShop/issues", + "members_url": "https://api.github.com/orgs/PrestaShop/members{/member}", + "public_members_url": "https://api.github.com/orgs/PrestaShop/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/2815696?v=3", + "description": "The free ecommerce solution to start your online business and start selling online. Build an online store for free with PrestaShop." + }, + "sender": { + "login": "Quetzacoalt91", + "id": 6768917, + "avatar_url": "https://avatars.githubusercontent.com/u/6768917?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/Quetzacoalt91", + "html_url": "https://github.com/Quetzacoalt91", + "followers_url": "https://api.github.com/users/Quetzacoalt91/followers", + "following_url": "https://api.github.com/users/Quetzacoalt91/following{/other_user}", + "gists_url": "https://api.github.com/users/Quetzacoalt91/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Quetzacoalt91/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Quetzacoalt91/subscriptions", + "organizations_url": "https://api.github.com/users/Quetzacoalt91/orgs", + "repos_url": "https://api.github.com/users/Quetzacoalt91/repos", + "events_url": "https://api.github.com/users/Quetzacoalt91/events{/privacy}", + "received_events_url": "https://api.github.com/users/Quetzacoalt91/received_events", + "type": "User", + "site_admin": false + } +}