{"action":"created","comment":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/86939543","pull_request_review_id":7570738,"id":86939543,"diff_hunk":"@@ -405,15 +389,8 @@ yii.validation = (function ($) {\n \n     function validateFile(file, messages, options) {\n         if (options.extensions && options.extensions.length > 0) {\n-            var index, ext;\n-\n-            index = file.name.lastIndexOf('.');\n-\n-            if (!~index) {","path":"framework/assets/yii.validation.js","position":230,"original_position":230,"commit_id":"f8199bddb779a28f484f291ce9a47ab0fd268f72","original_commit_id":"f8199bddb779a28f484f291ce9a47ab0fd268f72","user":{"login":"arogachev","id":8326201,"avatar_url":"https://avatars.githubusercontent.com/u/8326201?v=3","gravatar_id":"","url":"https://api.github.com/users/arogachev","html_url":"https://github.com/arogachev","followers_url":"https://api.github.com/users/arogachev/followers","following_url":"https://api.github.com/users/arogachev/following{/other_user}","gists_url":"https://api.github.com/users/arogachev/gists{/gist_id}","starred_url":"https://api.github.com/users/arogachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arogachev/subscriptions","organizations_url":"https://api.github.com/users/arogachev/orgs","repos_url":"https://api.github.com/users/arogachev/repos","events_url":"https://api.github.com/users/arogachev/events{/privacy}","received_events_url":"https://api.github.com/users/arogachev/received_events","type":"User","site_admin":false},"body":"Good candidate for one liner.","created_at":"2016-11-08T08:01:21Z","updated_at":"2016-11-08T08:01:21Z","html_url":"https://github.com/yiisoft/yii2/pull/12936#discussion_r86939543","pull_request_url":"https://api.github.com/repos/yiisoft/yii2/pulls/12936","_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/86939543"},"html":{"href":"https://github.com/yiisoft/yii2/pull/12936#discussion_r86939543"},"pull_request":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12936"}}},"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/12936","id":92722346,"html_url":"https://github.com/yiisoft/yii2/pull/12936","diff_url":"https://github.com/yiisoft/yii2/pull/12936.diff","patch_url":"https://github.com/yiisoft/yii2/pull/12936.patch","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/12936","number":12936,"state":"open","locked":false,"title":"#12840: Have at least basic tests for js","user":{"login":"arogachev","id":8326201,"avatar_url":"https://avatars.githubusercontent.com/u/8326201?v=3","gravatar_id":"","url":"https://api.github.com/users/arogachev","html_url":"https://github.com/arogachev","followers_url":"https://api.github.com/users/arogachev/followers","following_url":"https://api.github.com/users/arogachev/following{/other_user}","gists_url":"https://api.github.com/users/arogachev/gists{/gist_id}","starred_url":"https://api.github.com/users/arogachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arogachev/subscriptions","organizations_url":"https://api.github.com/users/arogachev/orgs","repos_url":"https://api.github.com/users/arogachev/repos","events_url":"https://api.github.com/users/arogachev/events{/privacy}","received_events_url":"https://api.github.com/users/arogachev/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Is bugfix?    | yes, it contains some bug fixes\r\n| New feature?  | no\r\n| Breaks BC?    | no\r\n| Tests pass?   | yes\r\n| Fixed issues  | #12840\r\n\r\n## Implemented tests\r\n\r\n- [ ] yii.activeForm.js\r\n- [ ] yii.captcha.js\r\n- [ ] yii.gridView.js\r\n- [ ] yii.js\r\n- [x] yii.validation.js\r\n\r\n## Running tests\r\n\r\n- Run `composer update` to install js dependencies (Mocha, Chai, Leche) via Composer Asset Plugin. They are installed using `bower-asset`.\r\n- Install Sinon using `npm install`. It can not be installed using `bower-asset` because of some additional compilation. See according problem in problems list.\r\n- Test app index file is `tests/js/web/index.php`. Point local web server to it and load home page from browser, for example: `http://yii2-js-tests.dev/`.\r\n\r\n## Problems list\r\n\r\n- [ ] Sinon can not be installed via Composer Asset Plugin. If I add line `\"npm-asset/sinon\": \"^1.17.6\"` to `required-dev` section of `composer.json` and run `composer update` I get the following error:\r\n\r\n```\r\n[RuntimeException]\r\nFailed to execute git clone --mirror 'git+ssh://git@github.com/sinonjs/sinon.git' '/home/vagrant/.composer/cache/vcs/git-ssh---git-github.com-sinonjs-sinon.git/'\r\nCloning into bare repository '/home/vagrant/.composer/cache/vcs/git-ssh---git-github.com-sinonjs-sinon.git'...\r\nPermission denied (publickey).\r\nfatal: Could not read from remote repository.\r\nPlease make sure you have the correct access rights and the repository exists.\r\n```\r\n\r\nPossibly related: https://github.com/fxpio/composer-asset-plugin/issues/187.\r\n\r\nI tried `--prefer-dist` option, that didn't help. I also have generated SSH key and it's added it to `ssh-agent` (error is mentioned in [git-workflow](https://github.com/yiisoft/yii2/blob/master/docs/internals/git-workflow.md#1-fork-the-yii-repository-on-github-and-clone-your-fork-to-your-development-environment) document which is a part of internal docs).\r\n\r\n- [ ] Sometimes \"image validator with FileReader API is not available\" test takes a long time to load and gives warning with time written inside of a red label. This is because of swapping native `FileReader`:\r\n\r\n```js\r\nvar initialFileReader = FileReader;\r\n\r\nbeforeEach(function () {\r\n    FileReader = undefined;\r\n});\r\n\r\nafterEach(function () {\r\n    FileReader = initialFileReader;\r\n});\r\n```\r\n\r\n- [ ] Run tests in command line instead of browser.\r\n\r\nBut it happens pretty seldom and increases time by about half of second only. Also I can't see a better solution for testing this, so this is not a big problem.\r\n\r\n","created_at":"2016-11-08T06:31:41Z","updated_at":"2016-11-08T08:01:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4845a86751c1bbc1786fba42718c3a84b233112","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yiisoft/yii2/pulls/12936/commits","review_comments_url":"https://api.github.com/repos/yiisoft/yii2/pulls/12936/comments","review_comment_url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/12936/comments","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/f8199bddb779a28f484f291ce9a47ab0fd268f72","head":{"label":"arogachev:12840-js-tests","ref":"12840-js-tests","sha":"f8199bddb779a28f484f291ce9a47ab0fd268f72","user":{"login":"arogachev","id":8326201,"avatar_url":"https://avatars.githubusercontent.com/u/8326201?v=3","gravatar_id":"","url":"https://api.github.com/users/arogachev","html_url":"https://github.com/arogachev","followers_url":"https://api.github.com/users/arogachev/followers","following_url":"https://api.github.com/users/arogachev/following{/other_user}","gists_url":"https://api.github.com/users/arogachev/gists{/gist_id}","starred_url":"https://api.github.com/users/arogachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arogachev/subscriptions","organizations_url":"https://api.github.com/users/arogachev/orgs","repos_url":"https://api.github.com/users/arogachev/repos","events_url":"https://api.github.com/users/arogachev/events{/privacy}","received_events_url":"https://api.github.com/users/arogachev/received_events","type":"User","site_admin":false},"repo":{"id":41841832,"name":"yii2","full_name":"arogachev/yii2","owner":{"login":"arogachev","id":8326201,"avatar_url":"https://avatars.githubusercontent.com/u/8326201?v=3","gravatar_id":"","url":"https://api.github.com/users/arogachev","html_url":"https://github.com/arogachev","followers_url":"https://api.github.com/users/arogachev/followers","following_url":"https://api.github.com/users/arogachev/following{/other_user}","gists_url":"https://api.github.com/users/arogachev/gists{/gist_id}","starred_url":"https://api.github.com/users/arogachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arogachev/subscriptions","organizations_url":"https://api.github.com/users/arogachev/orgs","repos_url":"https://api.github.com/users/arogachev/repos","events_url":"https://api.github.com/users/arogachev/events{/privacy}","received_events_url":"https://api.github.com/users/arogachev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arogachev/yii2","description":"Yii 2 framework main development repo","fork":true,"url":"https://api.github.com/repos/arogachev/yii2","forks_url":"https://api.github.com/repos/arogachev/yii2/forks","keys_url":"https://api.github.com/repos/arogachev/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arogachev/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arogachev/yii2/teams","hooks_url":"https://api.github.com/repos/arogachev/yii2/hooks","issue_events_url":"https://api.github.com/repos/arogachev/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/arogachev/yii2/events","assignees_url":"https://api.github.com/repos/arogachev/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/arogachev/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/arogachev/yii2/tags","blobs_url":"https://api.github.com/repos/arogachev/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arogachev/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arogachev/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/arogachev/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arogachev/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/arogachev/yii2/languages","stargazers_url":"https://api.github.com/repos/arogachev/yii2/stargazers","contributors_url":"https://api.github.com/repos/arogachev/yii2/contributors","subscribers_url":"https://api.github.com/repos/arogachev/yii2/subscribers","subscription_url":"https://api.github.com/repos/arogachev/yii2/subscription","commits_url":"https://api.github.com/repos/arogachev/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/arogachev/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/arogachev/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/arogachev/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/arogachev/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/arogachev/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arogachev/yii2/merges","archive_url":"https://api.github.com/repos/arogachev/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arogachev/yii2/downloads","issues_url":"https://api.github.com/repos/arogachev/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/arogachev/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/arogachev/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/arogachev/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arogachev/yii2/labels{/name}","releases_url":"https://api.github.com/repos/arogachev/yii2/releases{/id}","deployments_url":"https://api.github.com/repos/arogachev/yii2/deployments","created_at":"2015-09-03T04:26:43Z","updated_at":"2015-09-03T04:26:46Z","pushed_at":"2016-11-08T07:37:25Z","git_url":"git://github.com/arogachev/yii2.git","ssh_url":"git@github.com:arogachev/yii2.git","clone_url":"https://github.com/arogachev/yii2.git","svn_url":"https://github.com/arogachev/yii2","homepage":"http://www.yiiframework.com","size":40440,"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":"yiisoft:master","ref":"master","sha":"3c8d39e3f4c77c7c7c3980b80952b236bdcb523e","user":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":3431193,"name":"yii2","full_name":"yiisoft/yii2","owner":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yiisoft/yii2","description":"Yii 2 framework main development repo","fork":false,"url":"https://api.github.com/repos/yiisoft/yii2","forks_url":"https://api.github.com/repos/yiisoft/yii2/forks","keys_url":"https://api.github.com/repos/yiisoft/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yiisoft/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yiisoft/yii2/teams","hooks_url":"https://api.github.com/repos/yiisoft/yii2/hooks","issue_events_url":"https://api.github.com/repos/yiisoft/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/yiisoft/yii2/events","assignees_url":"https://api.github.com/repos/yiisoft/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/yiisoft/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/yiisoft/yii2/tags","blobs_url":"https://api.github.com/repos/yiisoft/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yiisoft/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yiisoft/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/yiisoft/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/yiisoft/yii2/languages","stargazers_url":"https://api.github.com/repos/yiisoft/yii2/stargazers","contributors_url":"https://api.github.com/repos/yiisoft/yii2/contributors","subscribers_url":"https://api.github.com/repos/yiisoft/yii2/subscribers","subscription_url":"https://api.github.com/repos/yiisoft/yii2/subscription","commits_url":"https://api.github.com/repos/yiisoft/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/yiisoft/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/yiisoft/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/yiisoft/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/yiisoft/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/yiisoft/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yiisoft/yii2/merges","archive_url":"https://api.github.com/repos/yiisoft/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yiisoft/yii2/downloads","issues_url":"https://api.github.com/repos/yiisoft/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/yiisoft/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/yiisoft/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/yiisoft/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yiisoft/yii2/labels{/name}","releases_url":"https://api.github.com/repos/yiisoft/yii2/releases{/id}","deployments_url":"https://api.github.com/repos/yiisoft/yii2/deployments","created_at":"2012-02-13T15:32:36Z","updated_at":"2016-11-08T07:35:50Z","pushed_at":"2016-11-08T07:41:58Z","git_url":"git://github.com/yiisoft/yii2.git","ssh_url":"git@github.com:yiisoft/yii2.git","clone_url":"https://github.com/yiisoft/yii2.git","svn_url":"https://github.com/yiisoft/yii2","homepage":"http://www.yiiframework.com","size":65015,"stargazers_count":9050,"watchers_count":9050,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5249,"mirror_url":null,"open_issues_count":843,"forks":5249,"open_issues":843,"watchers":9050,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12936"},"html":{"href":"https://github.com/yiisoft/yii2/pull/12936"},"issue":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/12936"},"comments":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/12936/comments"},"review_comments":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12936/comments"},"review_comment":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12936/commits"},"statuses":{"href":"https://api.github.com/repos/yiisoft/yii2/statuses/f8199bddb779a28f484f291ce9a47ab0fd268f72"}}}}
{"actor":{"display_login":"arogachev"}}