{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1401","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1401/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1401/comments","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1401/events","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1401","id":105098108,"number":1401,"title":"BDD: console siteaccess matching","user":{"login":"bdunogier","id":235928,"avatar_url":"https://avatars.githubusercontent.com/u/235928?v=3","gravatar_id":"","url":"https://api.github.com/users/bdunogier","html_url":"https://github.com/bdunogier","followers_url":"https://api.github.com/users/bdunogier/followers","following_url":"https://api.github.com/users/bdunogier/following{/other_user}","gists_url":"https://api.github.com/users/bdunogier/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunogier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunogier/subscriptions","organizations_url":"https://api.github.com/users/bdunogier/orgs","repos_url":"https://api.github.com/users/bdunogier/repos","events_url":"https://api.github.com/users/bdunogier/events{/privacy}","received_events_url":"https://api.github.com/users/bdunogier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-09-06T14:41:35Z","updated_at":"2015-09-11T09:11:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1401","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1401","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1401.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1401.patch"},"body":"> Story: [EZP-24774](https://jira.ez.no/browse/EZP-24774)\r\n> Related pull-requests: ~~ezsystems/BehatBundle#30~~, ezsystems/ezplatform#38\r\n\r\nTests that the siteaccess is correctly matched with and without the `--siteaccess` parameter.\r\n\r\nAdds a `mobile` siteaccess to the `clean` installer so that we have a valid scenario for testing.\r\n\r\n## TODO \r\n- [x] Check which siteaccess is the default one for the `clean` install (it differs from demo).\r\n- [ ] ~~Improve error reporting from behat~~\r\n- [x] Rebase\r\n- [ ] Remove 'test' changes"},"comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments/139494680","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1401#issuecomment-139494680","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1401","id":139494680,"user":{"login":"ezrobot","id":681611,"avatar_url":"https://avatars.githubusercontent.com/u/681611?v=3","gravatar_id":"","url":"https://api.github.com/users/ezrobot","html_url":"https://github.com/ezrobot","followers_url":"https://api.github.com/users/ezrobot/followers","following_url":"https://api.github.com/users/ezrobot/following{/other_user}","gists_url":"https://api.github.com/users/ezrobot/gists{/gist_id}","starred_url":"https://api.github.com/users/ezrobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezrobot/subscriptions","organizations_url":"https://api.github.com/users/ezrobot/orgs","repos_url":"https://api.github.com/users/ezrobot/repos","events_url":"https://api.github.com/users/ezrobot/events{/privacy}","received_events_url":"https://api.github.com/users/ezrobot/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T09:11:41Z","updated_at":"2015-09-11T09:11:41Z","body":"This Pull Request does not respect [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/), please, see the suggested diff below:\n\n```diff\nLoaded config from \"/jenkins/jenkins.std/jobs/PAPI-Pull-Request-code-sniffer/workspace/.php_cs\"\nF\nLegend: ?-unknown, I-invalid file syntax, file ignored, .-no changes, F-fixed, E-error\n   1) eZ/Bundle/EzPublishCoreBundle/Features/Context/ConsoleContext.php (single_quote, unused_use)\n      ---------- begin diff ----------\n      --- Original\n      +++ New\n      @@ @@\n       <?php\n       namespace eZ\\Bundle\\EzPublishCoreBundle\\Features\\Context;\n       \n       use Behat\\Behat\\Context\\Context;\n       use Behat\\Behat\\Context\\SnippetAcceptingContext;\n      -use Behat\\Behat\\Tester\\Exception\\PendingException;\n      \n      @@ @@\n               $siteaccessName = $this->getNonDefaultSiteaccessName();\n      -        Assertion::assertNotNull($siteaccessName, \"There is no siteaccess other than the default one\");\n      +        Assertion::assertNotNull($siteaccessName, 'There is no siteaccess other than the default one');\n               $this->it['siteaccess'] = $siteaccessName;\n           }\n       \n           /**\n            * @Then /^I expect it to be executed with it$/\n            */\n           public function iExpectItToBeExecutedWithIt()\n           {\n               Assertion::assertEquals($this->it['siteaccess'], $this->scriptOutput);\n           }\n       \n           /**\n            * Returns the name of an existing siteaccess that isn't the default one.\n            * @return string|null The siteaccess name, or null if there isn't one\n            */\n           private function getNonDefaultSiteaccessName()\n           {\n               $defaultSiteaccessName = $this->getDefaultSiteaccessName();\n               foreach ($this->getKernel()->getContainer()->getParameter('ezpublish.siteaccess.list') as $siteaccessName) {\n                   if ($siteaccessName !== $defaultSiteaccessName) {\n                       return $siteaccessName;\n                   }\n               }\n       \n               return null;\n           }\n       \n           /**\n            * @return ConfigResolverInterface\n            */\n           private function getConfigResolver()\n           {\n               return $this->getKernel()->getContainer()->get('ezpublish.config.resolver');\n           }\n       \n           private function getDefaultSiteaccessName()\n           {\n               return $this->getKernel()->getContainer()->getParameter('ezpublish.siteaccess.default');\n           }\n       }\n       \n      \n      ---------- end diff ----------\n\nFixed all files in 3.150 seconds, 11.250 MB memory used\n```\n"}}