{"action":"created","comment":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/57012610","id":57012610,"diff_hunk":"@@ -0,0 +1,107 @@\n+<?php\n+\n+/*\n+ * This file is part of the Sylius package.\n+ *\n+ * (c) Paweł Jędrzejewski\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace spec\\Sylius\\Behat\\Context\\Ui\\Admin;\n+\n+use Behat\\Behat\\Context\\Context;\n+use PhpSpec\\Exception\\Example\\NotEqualException;\n+use PhpSpec\\ObjectBehavior;\n+use Sylius\\Behat\\Context\\Ui\\Admin\\ManagingTaxCategoryContext;\n+use Sylius\\Behat\\Page\\Admin\\Crud\\IndexPageInterface;\n+use Sylius\\Behat\\Service\\Accessor\\NotificationAccessorInterface;\n+use Sylius\\Component\\Core\\Test\\Services\\SharedStorageInterface;\n+use Sylius\\Component\\Taxation\\Model\\TaxCategory;\n+\n+/**\n+ * @mixin ManagingTaxCategoryContext\n+ *\n+ * @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>\n+ */\n+class ManagingTaxCategoryContextSpec extends ObjectBehavior\n+{\n+    function let(\n+        SharedStorageInterface $sharedStorage,\n+        IndexPageInterface $taxCategoryIndexPage,\n+        NotificationAccessorInterface $notificationAccessor\n+    ) {\n+        $this->beConstructedWith($sharedStorage, $taxCategoryIndexPage, $notificationAccessor);\n+    }\n+\n+    function it_is_initializable()\n+    {\n+        $this->shouldHaveType('Sylius\\Behat\\Context\\Ui\\Admin\\ManagingTaxCategoryContext');\n+    }\n+\n+    function it_implements_context_interface()\n+    {\n+        $this->shouldImplement(Context::class);\n+    }\n+\n+    function it_deletes_tax_cateogry(\n+        IndexPageInterface $taxCategoryIndexPage,\n+        SharedStorageInterface $sharedStorage,\n+        TaxCategory $taxCategory\n+    ) {\n+        $taxCategory->getCode()->willReturn('alcohol');\n+\n+        $taxCategoryIndexPage->deleteResourceOnPage(['code' => 'alcohol'])->shouldBeCalled();\n+        $taxCategoryIndexPage->open()->shouldBeCalled();\n+        $sharedStorage->set('tax_category', $taxCategory)->shouldBeCalled();\n+\n+        $this->iDeletedTaxCategory($taxCategory);\n+    }\n+\n+    function it_checks_if_tax_category_does_not_exist_in_registry_any_more(\n+        TaxCategory $taxCategory,\n+        IndexPageInterface $taxCategoryIndexPage\n+    ) {\n+        $taxCategory->getCode()->willReturn('alcohol');\n+        $taxCategoryIndexPage->isResourceOnPage(['code' => 'alcohol'])->willReturn(false);\n+\n+        $this->thisTaxCategoryShouldNoLongerExistInTheRegistry($taxCategory);\n+    }\n+\n+    function it_throws_an_exception_if_tax_category_still_exist_in_registry(\n+        TaxCategory $taxCategory,\n+        IndexPageInterface $taxCategoryIndexPage\n+    ) {\n+        $taxCategory->getCode()->willReturn('alcohol');\n+        $taxCategoryIndexPage->isResourceOnPage(['code' => 'alcohol'])->willReturn(true);\n+\n+        $this\n+            ->shouldThrow(new \\InvalidArgumentException(\"Tax category with code alcohol exists but should not\"))\n+            ->during('thisTaxCategoryShouldNoLongerExistInTheRegistry', [$taxCategory])\n+        ;\n+    }\n+\n+    function it_checks_if_resource_was_successfully_deleted(NotificationAccessorInterface $notificationAccessor)","path":"src/Sylius/Behat/spec/Context/Ui/Admin/ManagingTaxCategoryContextSpec.php","position":85,"original_position":85,"commit_id":"ef4cc1cfe289fbd85937c7786fd51f3a497a77a7","original_commit_id":"ef4cc1cfe289fbd85937c7786fd51f3a497a77a7","user":{"login":"TheMadeleine","id":13198869,"avatar_url":"https://avatars.githubusercontent.com/u/13198869?v=3","gravatar_id":"","url":"https://api.github.com/users/TheMadeleine","html_url":"https://github.com/TheMadeleine","followers_url":"https://api.github.com/users/TheMadeleine/followers","following_url":"https://api.github.com/users/TheMadeleine/following{/other_user}","gists_url":"https://api.github.com/users/TheMadeleine/gists{/gist_id}","starred_url":"https://api.github.com/users/TheMadeleine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheMadeleine/subscriptions","organizations_url":"https://api.github.com/users/TheMadeleine/orgs","repos_url":"https://api.github.com/users/TheMadeleine/repos","events_url":"https://api.github.com/users/TheMadeleine/events{/privacy}","received_events_url":"https://api.github.com/users/TheMadeleine/received_events","type":"User","site_admin":false},"body":"a_resource?","created_at":"2016-03-22T15:55:46Z","updated_at":"2016-03-22T15:55:46Z","html_url":"https://github.com/Sylius/Sylius/pull/4573#discussion_r57012610","pull_request_url":"https://api.github.com/repos/Sylius/Sylius/pulls/4573","_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/57012610"},"html":{"href":"https://github.com/Sylius/Sylius/pull/4573#discussion_r57012610"},"pull_request":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/4573"}}},"pull_request":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/4573","id":63579674,"html_url":"https://github.com/Sylius/Sylius/pull/4573","diff_url":"https://github.com/Sylius/Sylius/pull/4573.diff","patch_url":"https://github.com/Sylius/Sylius/pull/4573.patch","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/4573","number":4573,"state":"open","locked":false,"title":"[Admin] Tax category deletion","user":{"login":"lchrusciel","id":6213903,"avatar_url":"https://avatars.githubusercontent.com/u/6213903?v=3","gravatar_id":"","url":"https://api.github.com/users/lchrusciel","html_url":"https://github.com/lchrusciel","followers_url":"https://api.github.com/users/lchrusciel/followers","following_url":"https://api.github.com/users/lchrusciel/following{/other_user}","gists_url":"https://api.github.com/users/lchrusciel/gists{/gist_id}","starred_url":"https://api.github.com/users/lchrusciel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchrusciel/subscriptions","organizations_url":"https://api.github.com/users/lchrusciel/orgs","repos_url":"https://api.github.com/users/lchrusciel/repos","events_url":"https://api.github.com/users/lchrusciel/events{/privacy}","received_events_url":"https://api.github.com/users/lchrusciel/received_events","type":"User","site_admin":false},"body":"| Q               | A\r\n| --------------- | ---\r\n| Bug fix?        | no\r\n| New feature?    | no\r\n| BC breaks?      | no\r\n| Deprecations?   | no\r\n| Related tickets | \r\n| License         | MIT\r\n| Doc PR          | \r\n\r\nBased on #4574","created_at":"2016-03-21T15:14:00Z","updated_at":"2016-03-22T15:55:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c98ee0ad204959707067ae137d764f2eb734f1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Sylius/Sylius/pulls/4573/commits","review_comments_url":"https://api.github.com/repos/Sylius/Sylius/pulls/4573/comments","review_comment_url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/4573/comments","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/ef4cc1cfe289fbd85937c7786fd51f3a497a77a7","head":{"label":"lchrusciel:tax-category-deletation","ref":"tax-category-deletation","sha":"ef4cc1cfe289fbd85937c7786fd51f3a497a77a7","user":{"login":"lchrusciel","id":6213903,"avatar_url":"https://avatars.githubusercontent.com/u/6213903?v=3","gravatar_id":"","url":"https://api.github.com/users/lchrusciel","html_url":"https://github.com/lchrusciel","followers_url":"https://api.github.com/users/lchrusciel/followers","following_url":"https://api.github.com/users/lchrusciel/following{/other_user}","gists_url":"https://api.github.com/users/lchrusciel/gists{/gist_id}","starred_url":"https://api.github.com/users/lchrusciel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchrusciel/subscriptions","organizations_url":"https://api.github.com/users/lchrusciel/orgs","repos_url":"https://api.github.com/users/lchrusciel/repos","events_url":"https://api.github.com/users/lchrusciel/events{/privacy}","received_events_url":"https://api.github.com/users/lchrusciel/received_events","type":"User","site_admin":false},"repo":{"id":27534661,"name":"Sylius","full_name":"lchrusciel/Sylius","owner":{"login":"lchrusciel","id":6213903,"avatar_url":"https://avatars.githubusercontent.com/u/6213903?v=3","gravatar_id":"","url":"https://api.github.com/users/lchrusciel","html_url":"https://github.com/lchrusciel","followers_url":"https://api.github.com/users/lchrusciel/followers","following_url":"https://api.github.com/users/lchrusciel/following{/other_user}","gists_url":"https://api.github.com/users/lchrusciel/gists{/gist_id}","starred_url":"https://api.github.com/users/lchrusciel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchrusciel/subscriptions","organizations_url":"https://api.github.com/users/lchrusciel/orgs","repos_url":"https://api.github.com/users/lchrusciel/repos","events_url":"https://api.github.com/users/lchrusciel/events{/privacy}","received_events_url":"https://api.github.com/users/lchrusciel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lchrusciel/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":true,"url":"https://api.github.com/repos/lchrusciel/Sylius","forks_url":"https://api.github.com/repos/lchrusciel/Sylius/forks","keys_url":"https://api.github.com/repos/lchrusciel/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lchrusciel/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lchrusciel/Sylius/teams","hooks_url":"https://api.github.com/repos/lchrusciel/Sylius/hooks","issue_events_url":"https://api.github.com/repos/lchrusciel/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/lchrusciel/Sylius/events","assignees_url":"https://api.github.com/repos/lchrusciel/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/lchrusciel/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/lchrusciel/Sylius/tags","blobs_url":"https://api.github.com/repos/lchrusciel/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lchrusciel/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lchrusciel/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/lchrusciel/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lchrusciel/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/lchrusciel/Sylius/languages","stargazers_url":"https://api.github.com/repos/lchrusciel/Sylius/stargazers","contributors_url":"https://api.github.com/repos/lchrusciel/Sylius/contributors","subscribers_url":"https://api.github.com/repos/lchrusciel/Sylius/subscribers","subscription_url":"https://api.github.com/repos/lchrusciel/Sylius/subscription","commits_url":"https://api.github.com/repos/lchrusciel/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/lchrusciel/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/lchrusciel/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/lchrusciel/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/lchrusciel/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/lchrusciel/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lchrusciel/Sylius/merges","archive_url":"https://api.github.com/repos/lchrusciel/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lchrusciel/Sylius/downloads","issues_url":"https://api.github.com/repos/lchrusciel/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/lchrusciel/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/lchrusciel/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/lchrusciel/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lchrusciel/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/lchrusciel/Sylius/releases{/id}","deployments_url":"https://api.github.com/repos/lchrusciel/Sylius/deployments","created_at":"2014-12-04T10:09:34Z","updated_at":"2016-01-12T07:29:40Z","pushed_at":"2016-03-22T14:48:23Z","git_url":"git://github.com/lchrusciel/Sylius.git","ssh_url":"git@github.com:lchrusciel/Sylius.git","clone_url":"https://github.com/lchrusciel/Sylius.git","svn_url":"https://github.com/lchrusciel/Sylius","homepage":"Sylius.org","size":28225,"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":"Sylius:master","ref":"master","sha":"300740d4f2bf517efa3eb8cd9d969abe15542820","user":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"repo":{"id":2717549,"name":"Sylius","full_name":"Sylius/Sylius","owner":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sylius/Sylius","description":"eCommerce PHP framework built on top of Symfony with component-based architecture and format-agnostic rendering. (HTML/JSON/XML)","fork":false,"url":"https://api.github.com/repos/Sylius/Sylius","forks_url":"https://api.github.com/repos/Sylius/Sylius/forks","keys_url":"https://api.github.com/repos/Sylius/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sylius/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sylius/Sylius/teams","hooks_url":"https://api.github.com/repos/Sylius/Sylius/hooks","issue_events_url":"https://api.github.com/repos/Sylius/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/Sylius/Sylius/events","assignees_url":"https://api.github.com/repos/Sylius/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/Sylius/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/Sylius/Sylius/tags","blobs_url":"https://api.github.com/repos/Sylius/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sylius/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sylius/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sylius/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/Sylius/Sylius/languages","stargazers_url":"https://api.github.com/repos/Sylius/Sylius/stargazers","contributors_url":"https://api.github.com/repos/Sylius/Sylius/contributors","subscribers_url":"https://api.github.com/repos/Sylius/Sylius/subscribers","subscription_url":"https://api.github.com/repos/Sylius/Sylius/subscription","commits_url":"https://api.github.com/repos/Sylius/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sylius/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sylius/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sylius/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sylius/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/Sylius/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sylius/Sylius/merges","archive_url":"https://api.github.com/repos/Sylius/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sylius/Sylius/downloads","issues_url":"https://api.github.com/repos/Sylius/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/Sylius/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/Sylius/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/Sylius/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sylius/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/Sylius/Sylius/releases{/id}","deployments_url":"https://api.github.com/repos/Sylius/Sylius/deployments","created_at":"2011-11-05T22:05:52Z","updated_at":"2016-03-22T00:31:07Z","pushed_at":"2016-03-22T15:47:44Z","git_url":"git://github.com/Sylius/Sylius.git","ssh_url":"git@github.com:Sylius/Sylius.git","clone_url":"https://github.com/Sylius/Sylius.git","svn_url":"https://github.com/Sylius/Sylius","homepage":"http://Sylius.org","size":60711,"stargazers_count":2215,"watchers_count":2215,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":809,"mirror_url":null,"open_issues_count":589,"forks":809,"open_issues":589,"watchers":2215,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/4573"},"html":{"href":"https://github.com/Sylius/Sylius/pull/4573"},"issue":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/4573"},"comments":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/4573/comments"},"review_comments":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/4573/comments"},"review_comment":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/4573/commits"},"statuses":{"href":"https://api.github.com/repos/Sylius/Sylius/statuses/ef4cc1cfe289fbd85937c7786fd51f3a497a77a7"}}}}