{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/comments/103713930","pull_request_review_id":24509070,"id":103713930,"diff_hunk":"@@ -0,0 +1,129 @@\n+<?php\n+/**\n+ * @see       https://github.com/zendframework/zend-expressive-tooling for the canonical source repository\n+ * @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)\n+ * @license   https://github.com/zendframework/zend-expressive-tooling/blob/master/LICENSE.md New BSD License\n+ */\n+\n+namespace ZendTest\\Expressive\\Tooling\\Module\\Command;\n+\n+use org\\bovigo\\vfs\\vfsStream;\n+use org\\bovigo\\vfs\\vfsStreamDirectory;\n+use phpmock\\phpunit\\PHPMock;\n+use PHPUnit\\Framework\\TestCase;\n+use Zend\\Expressive\\Tooling\\Module\\Command\\Create;\n+use Zend\\Expressive\\Tooling\\Module\\Exception;\n+\n+class CreateTest extends TestCase\n+{\n+    use PHPMock;\n+\n+    /** @var vfsStreamDirectory */\n+    private $dir;\n+\n+    /** @var vfsStreamDirectory */\n+    private $modulesDir;\n+\n+    /** @var string */\n+    private $composer = 'my-composer';\n+\n+    /** @var Create */\n+    private $command;\n+\n+    protected function setUp()\n+    {\n+        parent::setUp();\n+\n+        $this->dir = vfsStream::setup('project');\n+        $this->modulesDir = vfsStream::newDirectory('my-modules')->at($this->dir);\n+        $this->command = new Create($this->dir->url(), 'my-modules', $this->composer);\n+    }\n+\n+    public function testErrorsWhenModuleDirectoryAlreadyExists()\n+    {\n+        vfsStream::newDirectory('MyApp')->at($this->modulesDir);\n+\n+        $this->expectException(Exception\\RuntimeException::class);\n+        $this->expectExceptionMessage('Module \"MyApp\" already exists');\n+        $this->command->process('MyApp');\n+    }\n+\n+    public function testErrorsWhenCannotCreateModuleDirectory()\n+    {\n+        $baseModulePath = sprintf('%s/my-modules/MyApp', $this->dir->url());\n+\n+        $mkdir = $this->getFunctionMock('Zend\\Expressive\\Tooling\\Module\\Command', 'mkdir');","path":"test/Module/Command/CreateTest.php","position":55,"original_position":55,"commit_id":"1b4763f3a78f3424faa54bd464660fe5ae8da225","original_commit_id":"1b4763f3a78f3424faa54bd464660fe5ae8da225","user":{"login":"webimpress","id":7423207,"avatar_url":"https://avatars1.githubusercontent.com/u/7423207?v=3","gravatar_id":"","url":"https://api.github.com/users/webimpress","html_url":"https://github.com/webimpress","followers_url":"https://api.github.com/users/webimpress/followers","following_url":"https://api.github.com/users/webimpress/following{/other_user}","gists_url":"https://api.github.com/users/webimpress/gists{/gist_id}","starred_url":"https://api.github.com/users/webimpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webimpress/subscriptions","organizations_url":"https://api.github.com/users/webimpress/orgs","repos_url":"https://api.github.com/users/webimpress/repos","events_url":"https://api.github.com/users/webimpress/events{/privacy}","received_events_url":"https://api.github.com/users/webimpress/received_events","type":"User","site_admin":false},"body":"Please not this is _not_ from PHPUnit but from `php-mock` library. Integration with PHPUnit is via `php-mock/php-mock-phpunit`.","created_at":"2017-03-01T15:42:37Z","updated_at":"2017-03-01T15:42:37Z","html_url":"https://github.com/zendframework/zend-expressive-tooling/pull/12#discussion_r103713930","pull_request_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/comments/103713930"},"html":{"href":"https://github.com/zendframework/zend-expressive-tooling/pull/12#discussion_r103713930"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12","id":106763092,"html_url":"https://github.com/zendframework/zend-expressive-tooling/pull/12","diff_url":"https://github.com/zendframework/zend-expressive-tooling/pull/12.diff","patch_url":"https://github.com/zendframework/zend-expressive-tooling/pull/12.patch","issue_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues/12","number":12,"state":"open","locked":false,"title":"Added new tool - expressive-module (#8 and #9)","user":{"login":"webimpress","id":7423207,"avatar_url":"https://avatars1.githubusercontent.com/u/7423207?v=3","gravatar_id":"","url":"https://api.github.com/users/webimpress","html_url":"https://github.com/webimpress","followers_url":"https://api.github.com/users/webimpress/followers","following_url":"https://api.github.com/users/webimpress/following{/other_user}","gists_url":"https://api.github.com/users/webimpress/gists{/gist_id}","starred_url":"https://api.github.com/users/webimpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webimpress/subscriptions","organizations_url":"https://api.github.com/users/webimpress/orgs","repos_url":"https://api.github.com/users/webimpress/repos","events_url":"https://api.github.com/users/webimpress/events{/privacy}","received_events_url":"https://api.github.com/users/webimpress/received_events","type":"User","site_admin":false},"body":"New tool `vendor/bin/expressive-module`\r\n\r\nTool provide following commands:\r\n- `create` - create skeleton of the expressive module and register it\r\n- `register` - register module in configuration and composer autoloading\r\n- `deregister` - deregister module from configuration and composer autoloading\r\n\r\nTool accept following arguments:\r\n- `--composer|-c` path to composer binary\r\n- `--modules-path|-p` - path to modules directory\r\n\r\nTODO:\r\n- [x] tests\r\n  - [x] actions\r\n    - [x] create\r\n    - [x] register\r\n    - [x] deregister\r\n  - [x] main command\r\n  - [x] help\r\n- [x] implement disable module's composer autoloading - will be nice to have it in [`zfcampus/zf-composer-autoloading`](https://github.com/zfcampus/zf-composer-autoloading) as there is also registering module in composer.json - done in https://github.com/zfcampus/zf-composer-autoloading/issues/8\r\n- [x] would be nice to refactor [`zendframework/zend-component-installer`](https://github.com/zendframework/zend-component-installer) then we can have here less dependencies - now because we are using this library we require here `composer/composer` - done in https://github.com/zendframework/zend-component-installer/pull/34.\r\n\r\nResolves #8 and #9 ","created_at":"2017-02-17T16:14:17Z","updated_at":"2017-03-01T15:42:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7636f0c986caddcc34185d194cb5a190d8efe1a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues/12/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/statuses/1b4763f3a78f3424faa54bd464660fe5ae8da225","head":{"label":"webimpress:feature/module-tools","ref":"feature/module-tools","sha":"1b4763f3a78f3424faa54bd464660fe5ae8da225","user":{"login":"webimpress","id":7423207,"avatar_url":"https://avatars1.githubusercontent.com/u/7423207?v=3","gravatar_id":"","url":"https://api.github.com/users/webimpress","html_url":"https://github.com/webimpress","followers_url":"https://api.github.com/users/webimpress/followers","following_url":"https://api.github.com/users/webimpress/following{/other_user}","gists_url":"https://api.github.com/users/webimpress/gists{/gist_id}","starred_url":"https://api.github.com/users/webimpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webimpress/subscriptions","organizations_url":"https://api.github.com/users/webimpress/orgs","repos_url":"https://api.github.com/users/webimpress/repos","events_url":"https://api.github.com/users/webimpress/events{/privacy}","received_events_url":"https://api.github.com/users/webimpress/received_events","type":"User","site_admin":false},"repo":{"id":75817363,"name":"zend-expressive-tooling","full_name":"webimpress/zend-expressive-tooling","owner":{"login":"webimpress","id":7423207,"avatar_url":"https://avatars1.githubusercontent.com/u/7423207?v=3","gravatar_id":"","url":"https://api.github.com/users/webimpress","html_url":"https://github.com/webimpress","followers_url":"https://api.github.com/users/webimpress/followers","following_url":"https://api.github.com/users/webimpress/following{/other_user}","gists_url":"https://api.github.com/users/webimpress/gists{/gist_id}","starred_url":"https://api.github.com/users/webimpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webimpress/subscriptions","organizations_url":"https://api.github.com/users/webimpress/orgs","repos_url":"https://api.github.com/users/webimpress/repos","events_url":"https://api.github.com/users/webimpress/events{/privacy}","received_events_url":"https://api.github.com/users/webimpress/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/webimpress/zend-expressive-tooling","description":"Migration and development tooling for Expressive","fork":true,"url":"https://api.github.com/repos/webimpress/zend-expressive-tooling","forks_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/forks","keys_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/teams","hooks_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/hooks","issue_events_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/issues/events{/number}","events_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/events","assignees_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/assignees{/user}","branches_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/branches{/branch}","tags_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/tags","blobs_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/git/refs{/sha}","trees_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/statuses/{sha}","languages_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/languages","stargazers_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/stargazers","contributors_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/contributors","subscribers_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/subscribers","subscription_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/subscription","commits_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/commits{/sha}","git_commits_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/git/commits{/sha}","comments_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/comments{/number}","issue_comment_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/issues/comments{/number}","contents_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/contents/{+path}","compare_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/merges","archive_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/downloads","issues_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/issues{/number}","pulls_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/pulls{/number}","milestones_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/milestones{/number}","notifications_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/labels{/name}","releases_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/releases{/id}","deployments_url":"https://api.github.com/repos/webimpress/zend-expressive-tooling/deployments","created_at":"2016-12-07T08:51:20Z","updated_at":"2016-12-07T08:51:22Z","pushed_at":"2017-02-22T22:31:33Z","git_url":"git://github.com/webimpress/zend-expressive-tooling.git","ssh_url":"git@github.com:webimpress/zend-expressive-tooling.git","clone_url":"https://github.com/webimpress/zend-expressive-tooling.git","svn_url":"https://github.com/webimpress/zend-expressive-tooling","homepage":null,"size":182,"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":"zendframework:master","ref":"master","sha":"5d89a36baabef56dfebb47b6e8067a88116962e7","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars1.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":75752195,"name":"zend-expressive-tooling","full_name":"zendframework/zend-expressive-tooling","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars1.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-expressive-tooling","description":"Migration and development tooling for Expressive","fork":false,"url":"https://api.github.com/repos/zendframework/zend-expressive-tooling","forks_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/forks","keys_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/events","assignees_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/merges","archive_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/releases{/id}","deployments_url":"https://api.github.com/repos/zendframework/zend-expressive-tooling/deployments","created_at":"2016-12-06T16:55:26Z","updated_at":"2017-02-14T11:13:42Z","pushed_at":"2017-02-22T22:31:35Z","git_url":"git://github.com/zendframework/zend-expressive-tooling.git","ssh_url":"git@github.com:zendframework/zend-expressive-tooling.git","clone_url":"https://github.com/zendframework/zend-expressive-tooling.git","svn_url":"https://github.com/zendframework/zend-expressive-tooling","homepage":null,"size":139,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12"},"html":{"href":"https://github.com/zendframework/zend-expressive-tooling/pull/12"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues/12"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-expressive-tooling/statuses/1b4763f3a78f3424faa54bd464660fe5ae8da225"}}}}
{"actor":{"display_login":"webimpress"}}