{"action":"created","comment":{"url":"https://api.github.com/repos/tomaj/nette-api/pulls/comments/78292609","id":78292609,"diff_hunk":"@@ -0,0 +1,67 @@\n+<?php\n+\n+namespace Tomaj\\NetteApi\\Test\\Handler;\n+\n+use Nette\\Http\\Response;\n+use Tomaj\\NetteApi\\EndpointIdentifier;\n+use Tomaj\\NetteApi\\Handlers\\CorsPreflightHandler;\n+use Nette\\Application\\LinkGenerator;\n+use Nette\\Application\\Routers\\SimpleRouter;\n+use Nette\\Http\\Url;\n+use PHPUnit_Framework_TestCase;\n+\n+class CorsPreflightHandlerTest extends PHPUnit_Framework_TestCase\n+{\n+    public function testResponse()\n+    {\n+        $preflighthandler = new CorsPreflightHandler(new Response());\n+        $result = $preflighthandler->handle([]);\n+        $this->assertEquals(200, $result->getCode());\n+        $this->assertEquals([], $result->getPayload());\n+    }\n+\n+    public function testEndpointSetter()\n+    {\n+        $defaultHandler = new CorsPreflightHandler(new Response());\n+        $this->assertNull($defaultHandler->getEndpoint());\n+\n+        $endpointIdentifier = new EndpointIdentifier('OPTIONS', 1, 'article', 'detail');\n+        $defaultHandler->setEndpointIdentifier($endpointIdentifier);\n+        $this->assertEquals($endpointIdentifier, $defaultHandler->getEndpoint());\n+    }\n+\n+    /**\n+     * @expectedException \\Nette\\InvalidStateException","path":"tests/Handler/CorsPreflightHandlerTest.php","position":null,"original_position":34,"commit_id":"7e440048f7803609d42443f6a81b60402d38cbb2","original_commit_id":"867ff8518ed3bd709ea3ccf6336581314ad20d4b","user":{"login":"tomaj","id":446736,"avatar_url":"https://avatars.githubusercontent.com/u/446736?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaj","html_url":"https://github.com/tomaj","followers_url":"https://api.github.com/users/tomaj/followers","following_url":"https://api.github.com/users/tomaj/following{/other_user}","gists_url":"https://api.github.com/users/tomaj/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaj/subscriptions","organizations_url":"https://api.github.com/users/tomaj/orgs","repos_url":"https://api.github.com/users/tomaj/repos","events_url":"https://api.github.com/users/tomaj/events{/privacy}","received_events_url":"https://api.github.com/users/tomaj/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2016-09-11T11:04:56Z","updated_at":"2016-09-11T11:04:56Z","html_url":"https://github.com/tomaj/nette-api/pull/31#discussion_r78292609","pull_request_url":"https://api.github.com/repos/tomaj/nette-api/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/tomaj/nette-api/pulls/comments/78292609"},"html":{"href":"https://github.com/tomaj/nette-api/pull/31#discussion_r78292609"},"pull_request":{"href":"https://api.github.com/repos/tomaj/nette-api/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/tomaj/nette-api/pulls/31","id":84717172,"html_url":"https://github.com/tomaj/nette-api/pull/31","diff_url":"https://github.com/tomaj/nette-api/pull/31.diff","patch_url":"https://github.com/tomaj/nette-api/pull/31.patch","issue_url":"https://api.github.com/repos/tomaj/nette-api/issues/31","number":31,"state":"open","locked":false,"title":"Preflight - global handlers","user":{"login":"tomaj","id":446736,"avatar_url":"https://avatars.githubusercontent.com/u/446736?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaj","html_url":"https://github.com/tomaj","followers_url":"https://api.github.com/users/tomaj/followers","following_url":"https://api.github.com/users/tomaj/following{/other_user}","gists_url":"https://api.github.com/users/tomaj/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaj/subscriptions","organizations_url":"https://api.github.com/users/tomaj/orgs","repos_url":"https://api.github.com/users/tomaj/repos","events_url":"https://api.github.com/users/tomaj/events{/privacy}","received_events_url":"https://api.github.com/users/tomaj/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-09T20:52:25Z","updated_at":"2016-09-11T11:04:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0adc763aecbd57cf150b15ad1164f9f1f014bbf","assignee":{"login":"lulco","id":9377319,"avatar_url":"https://avatars.githubusercontent.com/u/9377319?v=3","gravatar_id":"","url":"https://api.github.com/users/lulco","html_url":"https://github.com/lulco","followers_url":"https://api.github.com/users/lulco/followers","following_url":"https://api.github.com/users/lulco/following{/other_user}","gists_url":"https://api.github.com/users/lulco/gists{/gist_id}","starred_url":"https://api.github.com/users/lulco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lulco/subscriptions","organizations_url":"https://api.github.com/users/lulco/orgs","repos_url":"https://api.github.com/users/lulco/repos","events_url":"https://api.github.com/users/lulco/events{/privacy}","received_events_url":"https://api.github.com/users/lulco/received_events","type":"User","site_admin":false},"assignees":[{"login":"lulco","id":9377319,"avatar_url":"https://avatars.githubusercontent.com/u/9377319?v=3","gravatar_id":"","url":"https://api.github.com/users/lulco","html_url":"https://github.com/lulco","followers_url":"https://api.github.com/users/lulco/followers","following_url":"https://api.github.com/users/lulco/following{/other_user}","gists_url":"https://api.github.com/users/lulco/gists{/gist_id}","starred_url":"https://api.github.com/users/lulco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lulco/subscriptions","organizations_url":"https://api.github.com/users/lulco/orgs","repos_url":"https://api.github.com/users/lulco/repos","events_url":"https://api.github.com/users/lulco/events{/privacy}","received_events_url":"https://api.github.com/users/lulco/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tomaj/nette-api/pulls/31/commits","review_comments_url":"https://api.github.com/repos/tomaj/nette-api/pulls/31/comments","review_comment_url":"https://api.github.com/repos/tomaj/nette-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tomaj/nette-api/issues/31/comments","statuses_url":"https://api.github.com/repos/tomaj/nette-api/statuses/7e440048f7803609d42443f6a81b60402d38cbb2","head":{"label":"tomaj:preflight","ref":"preflight","sha":"7e440048f7803609d42443f6a81b60402d38cbb2","user":{"login":"tomaj","id":446736,"avatar_url":"https://avatars.githubusercontent.com/u/446736?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaj","html_url":"https://github.com/tomaj","followers_url":"https://api.github.com/users/tomaj/followers","following_url":"https://api.github.com/users/tomaj/following{/other_user}","gists_url":"https://api.github.com/users/tomaj/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaj/subscriptions","organizations_url":"https://api.github.com/users/tomaj/orgs","repos_url":"https://api.github.com/users/tomaj/repos","events_url":"https://api.github.com/users/tomaj/events{/privacy}","received_events_url":"https://api.github.com/users/tomaj/received_events","type":"User","site_admin":false},"repo":{"id":42108369,"name":"nette-api","full_name":"tomaj/nette-api","owner":{"login":"tomaj","id":446736,"avatar_url":"https://avatars.githubusercontent.com/u/446736?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaj","html_url":"https://github.com/tomaj","followers_url":"https://api.github.com/users/tomaj/followers","following_url":"https://api.github.com/users/tomaj/following{/other_user}","gists_url":"https://api.github.com/users/tomaj/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaj/subscriptions","organizations_url":"https://api.github.com/users/tomaj/orgs","repos_url":"https://api.github.com/users/tomaj/repos","events_url":"https://api.github.com/users/tomaj/events{/privacy}","received_events_url":"https://api.github.com/users/tomaj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomaj/nette-api","description":" API solution for Nette framework with interactive generated console for each api","fork":false,"url":"https://api.github.com/repos/tomaj/nette-api","forks_url":"https://api.github.com/repos/tomaj/nette-api/forks","keys_url":"https://api.github.com/repos/tomaj/nette-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomaj/nette-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomaj/nette-api/teams","hooks_url":"https://api.github.com/repos/tomaj/nette-api/hooks","issue_events_url":"https://api.github.com/repos/tomaj/nette-api/issues/events{/number}","events_url":"https://api.github.com/repos/tomaj/nette-api/events","assignees_url":"https://api.github.com/repos/tomaj/nette-api/assignees{/user}","branches_url":"https://api.github.com/repos/tomaj/nette-api/branches{/branch}","tags_url":"https://api.github.com/repos/tomaj/nette-api/tags","blobs_url":"https://api.github.com/repos/tomaj/nette-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomaj/nette-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomaj/nette-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomaj/nette-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomaj/nette-api/statuses/{sha}","languages_url":"https://api.github.com/repos/tomaj/nette-api/languages","stargazers_url":"https://api.github.com/repos/tomaj/nette-api/stargazers","contributors_url":"https://api.github.com/repos/tomaj/nette-api/contributors","subscribers_url":"https://api.github.com/repos/tomaj/nette-api/subscribers","subscription_url":"https://api.github.com/repos/tomaj/nette-api/subscription","commits_url":"https://api.github.com/repos/tomaj/nette-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomaj/nette-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomaj/nette-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomaj/nette-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomaj/nette-api/contents/{+path}","compare_url":"https://api.github.com/repos/tomaj/nette-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomaj/nette-api/merges","archive_url":"https://api.github.com/repos/tomaj/nette-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomaj/nette-api/downloads","issues_url":"https://api.github.com/repos/tomaj/nette-api/issues{/number}","pulls_url":"https://api.github.com/repos/tomaj/nette-api/pulls{/number}","milestones_url":"https://api.github.com/repos/tomaj/nette-api/milestones{/number}","notifications_url":"https://api.github.com/repos/tomaj/nette-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomaj/nette-api/labels{/name}","releases_url":"https://api.github.com/repos/tomaj/nette-api/releases{/id}","deployments_url":"https://api.github.com/repos/tomaj/nette-api/deployments","created_at":"2015-09-08T11:33:02Z","updated_at":"2016-08-12T22:24:49Z","pushed_at":"2016-09-11T11:04:55Z","git_url":"git://github.com/tomaj/nette-api.git","ssh_url":"git@github.com:tomaj/nette-api.git","clone_url":"https://github.com/tomaj/nette-api.git","svn_url":"https://github.com/tomaj/nette-api","homepage":"","size":128,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":6,"default_branch":"master"}},"base":{"label":"tomaj:master","ref":"master","sha":"ebc249c04b30e2ab66e9c6c3f484c37ef4193440","user":{"login":"tomaj","id":446736,"avatar_url":"https://avatars.githubusercontent.com/u/446736?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaj","html_url":"https://github.com/tomaj","followers_url":"https://api.github.com/users/tomaj/followers","following_url":"https://api.github.com/users/tomaj/following{/other_user}","gists_url":"https://api.github.com/users/tomaj/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaj/subscriptions","organizations_url":"https://api.github.com/users/tomaj/orgs","repos_url":"https://api.github.com/users/tomaj/repos","events_url":"https://api.github.com/users/tomaj/events{/privacy}","received_events_url":"https://api.github.com/users/tomaj/received_events","type":"User","site_admin":false},"repo":{"id":42108369,"name":"nette-api","full_name":"tomaj/nette-api","owner":{"login":"tomaj","id":446736,"avatar_url":"https://avatars.githubusercontent.com/u/446736?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaj","html_url":"https://github.com/tomaj","followers_url":"https://api.github.com/users/tomaj/followers","following_url":"https://api.github.com/users/tomaj/following{/other_user}","gists_url":"https://api.github.com/users/tomaj/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaj/subscriptions","organizations_url":"https://api.github.com/users/tomaj/orgs","repos_url":"https://api.github.com/users/tomaj/repos","events_url":"https://api.github.com/users/tomaj/events{/privacy}","received_events_url":"https://api.github.com/users/tomaj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomaj/nette-api","description":" API solution for Nette framework with interactive generated console for each api","fork":false,"url":"https://api.github.com/repos/tomaj/nette-api","forks_url":"https://api.github.com/repos/tomaj/nette-api/forks","keys_url":"https://api.github.com/repos/tomaj/nette-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomaj/nette-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomaj/nette-api/teams","hooks_url":"https://api.github.com/repos/tomaj/nette-api/hooks","issue_events_url":"https://api.github.com/repos/tomaj/nette-api/issues/events{/number}","events_url":"https://api.github.com/repos/tomaj/nette-api/events","assignees_url":"https://api.github.com/repos/tomaj/nette-api/assignees{/user}","branches_url":"https://api.github.com/repos/tomaj/nette-api/branches{/branch}","tags_url":"https://api.github.com/repos/tomaj/nette-api/tags","blobs_url":"https://api.github.com/repos/tomaj/nette-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomaj/nette-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomaj/nette-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomaj/nette-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomaj/nette-api/statuses/{sha}","languages_url":"https://api.github.com/repos/tomaj/nette-api/languages","stargazers_url":"https://api.github.com/repos/tomaj/nette-api/stargazers","contributors_url":"https://api.github.com/repos/tomaj/nette-api/contributors","subscribers_url":"https://api.github.com/repos/tomaj/nette-api/subscribers","subscription_url":"https://api.github.com/repos/tomaj/nette-api/subscription","commits_url":"https://api.github.com/repos/tomaj/nette-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomaj/nette-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomaj/nette-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomaj/nette-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomaj/nette-api/contents/{+path}","compare_url":"https://api.github.com/repos/tomaj/nette-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomaj/nette-api/merges","archive_url":"https://api.github.com/repos/tomaj/nette-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomaj/nette-api/downloads","issues_url":"https://api.github.com/repos/tomaj/nette-api/issues{/number}","pulls_url":"https://api.github.com/repos/tomaj/nette-api/pulls{/number}","milestones_url":"https://api.github.com/repos/tomaj/nette-api/milestones{/number}","notifications_url":"https://api.github.com/repos/tomaj/nette-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomaj/nette-api/labels{/name}","releases_url":"https://api.github.com/repos/tomaj/nette-api/releases{/id}","deployments_url":"https://api.github.com/repos/tomaj/nette-api/deployments","created_at":"2015-09-08T11:33:02Z","updated_at":"2016-08-12T22:24:49Z","pushed_at":"2016-09-11T11:04:55Z","git_url":"git://github.com/tomaj/nette-api.git","ssh_url":"git@github.com:tomaj/nette-api.git","clone_url":"https://github.com/tomaj/nette-api.git","svn_url":"https://github.com/tomaj/nette-api","homepage":"","size":128,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tomaj/nette-api/pulls/31"},"html":{"href":"https://github.com/tomaj/nette-api/pull/31"},"issue":{"href":"https://api.github.com/repos/tomaj/nette-api/issues/31"},"comments":{"href":"https://api.github.com/repos/tomaj/nette-api/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/tomaj/nette-api/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/tomaj/nette-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tomaj/nette-api/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/tomaj/nette-api/statuses/7e440048f7803609d42443f6a81b60402d38cbb2"}}}}
{"actor":{"display_login":"tomaj"}}