{"action":"created","comment":{"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments/45319055","id":45319055,"diff_hunk":"@@ -0,0 +1,87 @@\n+<?php\n+\n+namespace OpenOrchestra\\WorkflowFunctionAdminBundle\\Tests\\AuthorizeStatusChange\\Strategies;\n+\n+use OpenOrchestra\\Backoffice\\AuthorizeEdition\\TemplateStrategy;\n+use Phake;\n+\n+/**\n+ * Class TemplateStrategyTest\n+ */\n+class TemplateStrategyTest extends \\PHPUnit_Framework_TestCase\n+{\n+    /**\n+     * @var TemplateStrategy\n+     */\n+    protected $templateStrategy;\n+    protected $templateRepository;\n+    protected $authorizationChecker;\n+\n+    /**\n+     * setUp\n+     */\n+    public function setUp()\n+    {\n+        $this->authorizationChecker = Phake::mock('Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationCheckerInterface');\n+        $this->templateRepository = Phake::mock('OpenOrchestra\\ModelInterface\\Repository\\TemplateRepositoryInterface');\n+        $this->templateStrategy = new TemplateStrategy($this->templateRepository, $this->authorizationChecker);\n+    }\n+\n+    /**\n+     * test getName\n+     */\n+    public function testGetName()\n+    {\n+        $this->assertSame($this->templateStrategy->getName(), 'template');\n+    }\n+\n+    /**\n+     * test support\n+     *\n+     * @param StatusableInterface $document\n+     * @param bool                $expectedResult\n+     *\n+     * @dataProvider provideTestSupport\n+     */\n+    public function testSupport($document, $expectedResult)\n+    {\n+        $document = Phake::mock($document);\n+        $this->assertSame($this->templateStrategy->support($document), $expectedResult);\n+    }\n+\n+    /**\n+     * @return array\n+     */\n+    public function provideTestSupport()\n+    {\n+        return array(\n+            array('OpenOrchestra\\ModelInterface\\Model\\StatusableInterface', false),\n+            array('OpenOrchestra\\ModelInterface\\Model\\TemplateInterface', true)\n+        );\n+    }\n+\n+    /**\n+     * @param StatusableInterface $document\n+     * @param bool                $isGranted\n+     * @param bool                $editable\n+     *\n+     * @dataProvider provideTestIsEditable\n+     */\n+    public function testIsEditable($document,$isGranted, $editable)\n+    {\n+        $document = Phake::mock($document);","path":"BackofficeBundle/Tests/AuthorizeEdition/TemplateStrategyTest.php","position":72,"original_position":72,"commit_id":"0dda17fbec34687ff56f7823f781de4e2651ca3a","original_commit_id":"0dda17fbec34687ff56f7823f781de4e2651ca3a","user":{"login":"nicolasThal","id":2675545,"avatar_url":"https://avatars.githubusercontent.com/u/2675545?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasThal","html_url":"https://github.com/nicolasThal","followers_url":"https://api.github.com/users/nicolasThal/followers","following_url":"https://api.github.com/users/nicolasThal/following{/other_user}","gists_url":"https://api.github.com/users/nicolasThal/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasThal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasThal/subscriptions","organizations_url":"https://api.github.com/users/nicolasThal/orgs","repos_url":"https://api.github.com/users/nicolasThal/repos","events_url":"https://api.github.com/users/nicolasThal/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasThal/received_events","type":"User","site_admin":false},"body":"As your document is always a `TemplateInterface` i think that you could extract the `$document` from the dataProvider","created_at":"2015-11-19T09:44:14Z","updated_at":"2015-11-19T09:44:14Z","html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/1179#discussion_r45319055","pull_request_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179","_links":{"self":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments/45319055"},"html":{"href":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/1179#discussion_r45319055"},"pull_request":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179"}}},"pull_request":{"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179","id":49796524,"html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/1179","diff_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/1179.diff","patch_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/1179.patch","issue_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/1179","number":1179,"state":"open","locked":false,"title":"1.1 add roles on templates","user":{"login":"ggrasset","id":15250971,"avatar_url":"https://avatars.githubusercontent.com/u/15250971?v=3","gravatar_id":"","url":"https://api.github.com/users/ggrasset","html_url":"https://github.com/ggrasset","followers_url":"https://api.github.com/users/ggrasset/followers","following_url":"https://api.github.com/users/ggrasset/following{/other_user}","gists_url":"https://api.github.com/users/ggrasset/gists{/gist_id}","starred_url":"https://api.github.com/users/ggrasset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggrasset/subscriptions","organizations_url":"https://api.github.com/users/ggrasset/orgs","repos_url":"https://api.github.com/users/ggrasset/repos","events_url":"https://api.github.com/users/ggrasset/events{/privacy}","received_events_url":"https://api.github.com/users/ggrasset/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-05T08:52:27Z","updated_at":"2015-11-19T09:44:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f208d95aaeffbe88953c343edce7abab34a0bb39","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179/commits","review_comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179/comments","review_comment_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/1179/comments","statuses_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/0dda17fbec34687ff56f7823f781de4e2651ca3a","head":{"label":"open-orchestra:1.1-add_roles_on_templates","ref":"1.1-add_roles_on_templates","sha":"0dda17fbec34687ff56f7823f781de4e2651ca3a","user":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"repo":{"id":21900253,"name":"open-orchestra-cms-bundle","full_name":"open-orchestra/open-orchestra-cms-bundle","owner":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","description":"The open orchestra cms bundle","fork":false,"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle","forks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/forks","keys_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/teams","hooks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/hooks","issue_events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/events","assignees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/tags","blobs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/languages","stargazers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/stargazers","contributors_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contributors","subscribers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscribers","subscription_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscription","commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/merges","archive_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/downloads","issues_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/labels{/name}","releases_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/releases{/id}","created_at":"2014-07-16T12:49:27Z","updated_at":"2015-11-06T17:19:48Z","pushed_at":"2015-11-19T09:15:53Z","git_url":"git://github.com/open-orchestra/open-orchestra-cms-bundle.git","ssh_url":"git@github.com:open-orchestra/open-orchestra-cms-bundle.git","clone_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle.git","svn_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","homepage":"http://open-orchestra.com","size":16250,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":2,"default_branch":"master"}},"base":{"label":"open-orchestra:master","ref":"master","sha":"514735b7bdf84106ee767ba1232eac523b51f416","user":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"repo":{"id":21900253,"name":"open-orchestra-cms-bundle","full_name":"open-orchestra/open-orchestra-cms-bundle","owner":{"login":"open-orchestra","id":11756116,"avatar_url":"https://avatars.githubusercontent.com/u/11756116?v=3","gravatar_id":"","url":"https://api.github.com/users/open-orchestra","html_url":"https://github.com/open-orchestra","followers_url":"https://api.github.com/users/open-orchestra/followers","following_url":"https://api.github.com/users/open-orchestra/following{/other_user}","gists_url":"https://api.github.com/users/open-orchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/open-orchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-orchestra/subscriptions","organizations_url":"https://api.github.com/users/open-orchestra/orgs","repos_url":"https://api.github.com/users/open-orchestra/repos","events_url":"https://api.github.com/users/open-orchestra/events{/privacy}","received_events_url":"https://api.github.com/users/open-orchestra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","description":"The open orchestra cms bundle","fork":false,"url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle","forks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/forks","keys_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/teams","hooks_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/hooks","issue_events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/events","assignees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/tags","blobs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/languages","stargazers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/stargazers","contributors_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contributors","subscribers_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscribers","subscription_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/subscription","commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/merges","archive_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/downloads","issues_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/labels{/name}","releases_url":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/releases{/id}","created_at":"2014-07-16T12:49:27Z","updated_at":"2015-11-06T17:19:48Z","pushed_at":"2015-11-19T09:15:53Z","git_url":"git://github.com/open-orchestra/open-orchestra-cms-bundle.git","ssh_url":"git@github.com:open-orchestra/open-orchestra-cms-bundle.git","clone_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle.git","svn_url":"https://github.com/open-orchestra/open-orchestra-cms-bundle","homepage":"http://open-orchestra.com","size":16250,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179"},"html":{"href":"https://github.com/open-orchestra/open-orchestra-cms-bundle/pull/1179"},"issue":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/1179"},"comments":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/issues/1179/comments"},"review_comments":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179/comments"},"review_comment":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/pulls/1179/commits"},"statuses":{"href":"https://api.github.com/repos/open-orchestra/open-orchestra-cms-bundle/statuses/0dda17fbec34687ff56f7823f781de4e2651ca3a"}}}}