{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/143328296","pull_request_review_id":67830734,"id":143328296,"diff_hunk":"@@ -145,6 +148,76 @@ public function testWriteWritesCache()\n         $this->assertSame($cache->toJson(), $actualCacheJson);\n     }\n \n+    public function testWriteCacheToDirectory()\n+    {\n+        $dir = __DIR__.'/../Fixtures/cache-file-handler';\n+\n+        $handler = new FileHandler($dir);\n+\n+        $this->setExpectedExceptionRegExp(\n+            'Symfony\\Component\\Filesystem\\Exception\\IOException',\n+            sprintf('#^%s$#', preg_quote('Cannot write cache file \"'.realpath($dir).'\" as the location exists as directory.', '#')\n+        ));\n+\n+        $handler->write(new Cache(new Signature(\n+            PHP_VERSION,\n+            '2.0',\n+            array(\n+                'foo',\n+                'bar',\n+            )\n+        )));\n+    }\n+\n+    public function testWriteCacheToNonWriteableFile()\n+    {\n+        $file = __DIR__.'/../Fixtures/cache-file-handler/cache-file';\n+        if (is_writable($file)) {\n+            $this->markTestSkipped(sprintf('File \"%s\" must be not writeable for this tests.', realpath($file)));\n+\n+            return;\n+        }\n+\n+        $handler = new FileHandler($file);\n+\n+        $this->setExpectedExceptionRegExp(\n+            'Symfony\\Component\\Filesystem\\Exception\\IOException',\n+            sprintf('#^%s$#', preg_quote('Cannot write to file \"'.realpath($file).'\" as it is not writable.', '#')\n+        ));\n+\n+        $handler->write(new Cache(new Signature(\n+            PHP_VERSION,\n+            '2.0',\n+            array(\n+                'foo',\n+                'bar',\n+            )\n+        )));\n+    }\n+\n+    public function testWriteCacheFilePermissions()\n+    {\n+        $file = __DIR__.'/../Fixtures/cache-file-handler/rw_cache.test';\n+        @unlink($file);","path":"tests/Cache/FileHandlerTest.php","position":71,"original_position":71,"commit_id":"cda7bf908fcbb0aa41e26dfe2dd5ecdedc8e61bc","original_commit_id":"cda7bf908fcbb0aa41e26dfe2dd5ecdedc8e61bc","user":{"login":"keradus","id":2716794,"avatar_url":"https://avatars1.githubusercontent.com/u/2716794?v=4","gravatar_id":"","url":"https://api.github.com/users/keradus","html_url":"https://github.com/keradus","followers_url":"https://api.github.com/users/keradus/followers","following_url":"https://api.github.com/users/keradus/following{/other_user}","gists_url":"https://api.github.com/users/keradus/gists{/gist_id}","starred_url":"https://api.github.com/users/keradus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keradus/subscriptions","organizations_url":"https://api.github.com/users/keradus/orgs","repos_url":"https://api.github.com/users/keradus/repos","events_url":"https://api.github.com/users/keradus/events{/privacy}","received_events_url":"https://api.github.com/users/keradus/received_events","type":"User","site_admin":false},"body":"why? this file must not exist before test execution","created_at":"2017-10-07T11:03:25Z","updated_at":"2017-10-07T11:03:25Z","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3123#discussion_r143328296","pull_request_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/143328296"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3123#discussion_r143328296"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123","id":144600393,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3123","diff_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3123.diff","patch_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3123.patch","issue_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/3123","number":3123,"state":"open","locked":false,"title":"Cache - File permissions.","user":{"login":"SpacePossum","id":10462973,"avatar_url":"https://avatars1.githubusercontent.com/u/10462973?v=4","gravatar_id":"","url":"https://api.github.com/users/SpacePossum","html_url":"https://github.com/SpacePossum","followers_url":"https://api.github.com/users/SpacePossum/followers","following_url":"https://api.github.com/users/SpacePossum/following{/other_user}","gists_url":"https://api.github.com/users/SpacePossum/gists{/gist_id}","starred_url":"https://api.github.com/users/SpacePossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpacePossum/subscriptions","organizations_url":"https://api.github.com/users/SpacePossum/orgs","repos_url":"https://api.github.com/users/SpacePossum/repos","events_url":"https://api.github.com/users/SpacePossum/events{/privacy}","received_events_url":"https://api.github.com/users/SpacePossum/received_events","type":"User","site_admin":false},"body":"lets try on `master` first and backport if effective","created_at":"2017-10-04T07:38:29Z","updated_at":"2017-10-07T11:03:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b9577afbddb84c736782c85d3dd2d276b5a8ca4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/milestones/75","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/milestone/75","labels_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/milestones/75/labels","id":2807998,"number":75,"title":"2.2.9","description":"","creator":{"login":"julienfalque","id":1736542,"avatar_url":"https://avatars1.githubusercontent.com/u/1736542?v=4","gravatar_id":"","url":"https://api.github.com/users/julienfalque","html_url":"https://github.com/julienfalque","followers_url":"https://api.github.com/users/julienfalque/followers","following_url":"https://api.github.com/users/julienfalque/following{/other_user}","gists_url":"https://api.github.com/users/julienfalque/gists{/gist_id}","starred_url":"https://api.github.com/users/julienfalque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienfalque/subscriptions","organizations_url":"https://api.github.com/users/julienfalque/orgs","repos_url":"https://api.github.com/users/julienfalque/repos","events_url":"https://api.github.com/users/julienfalque/events{/privacy}","received_events_url":"https://api.github.com/users/julienfalque/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2017-10-02T17:51:19Z","updated_at":"2017-10-07T10:52:30Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123/commits","review_comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123/comments","review_comment_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/3123/comments","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/cda7bf908fcbb0aa41e26dfe2dd5ecdedc8e61bc","head":{"label":"SpacePossum:master_cache_file_permissions","ref":"master_cache_file_permissions","sha":"cda7bf908fcbb0aa41e26dfe2dd5ecdedc8e61bc","user":{"login":"SpacePossum","id":10462973,"avatar_url":"https://avatars1.githubusercontent.com/u/10462973?v=4","gravatar_id":"","url":"https://api.github.com/users/SpacePossum","html_url":"https://github.com/SpacePossum","followers_url":"https://api.github.com/users/SpacePossum/followers","following_url":"https://api.github.com/users/SpacePossum/following{/other_user}","gists_url":"https://api.github.com/users/SpacePossum/gists{/gist_id}","starred_url":"https://api.github.com/users/SpacePossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpacePossum/subscriptions","organizations_url":"https://api.github.com/users/SpacePossum/orgs","repos_url":"https://api.github.com/users/SpacePossum/repos","events_url":"https://api.github.com/users/SpacePossum/events{/privacy}","received_events_url":"https://api.github.com/users/SpacePossum/received_events","type":"User","site_admin":false},"repo":{"id":29018102,"name":"PHP-CS-Fixer","full_name":"SpacePossum/PHP-CS-Fixer","owner":{"login":"SpacePossum","id":10462973,"avatar_url":"https://avatars1.githubusercontent.com/u/10462973?v=4","gravatar_id":"","url":"https://api.github.com/users/SpacePossum","html_url":"https://github.com/SpacePossum","followers_url":"https://api.github.com/users/SpacePossum/followers","following_url":"https://api.github.com/users/SpacePossum/following{/other_user}","gists_url":"https://api.github.com/users/SpacePossum/gists{/gist_id}","starred_url":"https://api.github.com/users/SpacePossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpacePossum/subscriptions","organizations_url":"https://api.github.com/users/SpacePossum/orgs","repos_url":"https://api.github.com/users/SpacePossum/repos","events_url":"https://api.github.com/users/SpacePossum/events{/privacy}","received_events_url":"https://api.github.com/users/SpacePossum/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SpacePossum/PHP-CS-Fixer","description":"Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible)","fork":true,"url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/releases{/id}","deployments_url":"https://api.github.com/repos/SpacePossum/PHP-CS-Fixer/deployments","created_at":"2015-01-09T13:46:11Z","updated_at":"2017-06-26T10:42:39Z","pushed_at":"2017-10-05T09:26:55Z","git_url":"git://github.com/SpacePossum/PHP-CS-Fixer.git","ssh_url":"git@github.com:SpacePossum/PHP-CS-Fixer.git","clone_url":"https://github.com/SpacePossum/PHP-CS-Fixer.git","svn_url":"https://github.com/SpacePossum/PHP-CS-Fixer","homepage":"cs.sensiolabs.org","size":9925,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FriendsOfPHP:2.2","ref":"2.2","sha":"cdc9bfc1d6d81ebb1572ac512f239b6bd063d116","user":{"login":"FriendsOfPHP","id":5947812,"avatar_url":"https://avatars0.githubusercontent.com/u/5947812?v=4","gravatar_id":"","url":"https://api.github.com/users/FriendsOfPHP","html_url":"https://github.com/FriendsOfPHP","followers_url":"https://api.github.com/users/FriendsOfPHP/followers","following_url":"https://api.github.com/users/FriendsOfPHP/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfPHP/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfPHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfPHP/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfPHP/orgs","repos_url":"https://api.github.com/users/FriendsOfPHP/repos","events_url":"https://api.github.com/users/FriendsOfPHP/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfPHP/received_events","type":"Organization","site_admin":false},"repo":{"id":4344257,"name":"PHP-CS-Fixer","full_name":"FriendsOfPHP/PHP-CS-Fixer","owner":{"login":"FriendsOfPHP","id":5947812,"avatar_url":"https://avatars0.githubusercontent.com/u/5947812?v=4","gravatar_id":"","url":"https://api.github.com/users/FriendsOfPHP","html_url":"https://github.com/FriendsOfPHP","followers_url":"https://api.github.com/users/FriendsOfPHP/followers","following_url":"https://api.github.com/users/FriendsOfPHP/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfPHP/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfPHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfPHP/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfPHP/orgs","repos_url":"https://api.github.com/users/FriendsOfPHP/repos","events_url":"https://api.github.com/users/FriendsOfPHP/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfPHP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer","description":"A tool to automatically fix PHP coding standards issues","fork":false,"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/releases{/id}","deployments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/deployments","created_at":"2012-05-16T06:42:23Z","updated_at":"2017-10-07T10:21:17Z","pushed_at":"2017-10-07T10:58:47Z","git_url":"git://github.com/FriendsOfPHP/PHP-CS-Fixer.git","ssh_url":"git@github.com:FriendsOfPHP/PHP-CS-Fixer.git","clone_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer.git","svn_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer","homepage":"http://cs.sensiolabs.org","size":10751,"stargazers_count":4886,"watchers_count":4886,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":746,"mirror_url":null,"open_issues_count":138,"forks":746,"open_issues":138,"watchers":4886,"default_branch":"2.7"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3123"},"issue":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/3123"},"comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/3123/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123/comments"},"review_comment":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/3123/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/cda7bf908fcbb0aa41e26dfe2dd5ecdedc8e61bc"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"keradus"}}