{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/46","repository_url":"https://api.github.com/repos/ezsystems/BehatBundle","labels_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/46/comments","events_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/46/events","html_url":"https://github.com/ezsystems/BehatBundle/pull/46","id":131074660,"number":46,"title":"Clean Environment before running BDD tests using the Platform Installer","user":{"login":"miguelcleverti","id":8983122,"avatar_url":"https://avatars.githubusercontent.com/u/8983122?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelcleverti","html_url":"https://github.com/miguelcleverti","followers_url":"https://api.github.com/users/miguelcleverti/followers","following_url":"https://api.github.com/users/miguelcleverti/following{/other_user}","gists_url":"https://api.github.com/users/miguelcleverti/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelcleverti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelcleverti/subscriptions","organizations_url":"https://api.github.com/users/miguelcleverti/orgs","repos_url":"https://api.github.com/users/miguelcleverti/repos","events_url":"https://api.github.com/users/miguelcleverti/events{/privacy}","received_events_url":"https://api.github.com/users/miguelcleverti/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-02-03T16:21:56Z","updated_at":"2016-02-04T15:21:31Z","closed_at":"2016-02-04T15:21:31Z","pull_request":{"url":"https://api.github.com/repos/ezsystems/BehatBundle/pulls/46","html_url":"https://github.com/ezsystems/BehatBundle/pull/46","diff_url":"https://github.com/ezsystems/BehatBundle/pull/46.diff","patch_url":"https://github.com/ezsystems/BehatBundle/pull/46.patch"},"body":"Before each test the environment should be clean to ensure the tests are isolated between each other.\r\n\r\nUsing the [Installer](https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Bundle/PlatformInstallerBundle/src/Installer/DbBasedInstaller.php) we can clean the database to a default installation as well as the other dependencies.\r\n\r\nTo guaranty that the environment is only cleaned once, so it won't cause unexpected behavior, we use a helper that stores it's state. Maybe there is a better way to do this?! Suggestions are welcome!\r\n\r\nHowever this solution works and is fairly simple. This approach was chosen because using the Behat hooks ''@BeforeScenario\" would cause the tests to be slow and the \"@BeforeSuite\"/\"@BeforeFeature\" must use `static` methods which do not have access to the class non-static attributes, thus we cannot used our injected installer service."},"comment":{"url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/comments/179896520","html_url":"https://github.com/ezsystems/BehatBundle/pull/46#issuecomment-179896520","issue_url":"https://api.github.com/repos/ezsystems/BehatBundle/issues/46","id":179896520,"user":{"login":"miguelcleverti","id":8983122,"avatar_url":"https://avatars.githubusercontent.com/u/8983122?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelcleverti","html_url":"https://github.com/miguelcleverti","followers_url":"https://api.github.com/users/miguelcleverti/followers","following_url":"https://api.github.com/users/miguelcleverti/following{/other_user}","gists_url":"https://api.github.com/users/miguelcleverti/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelcleverti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelcleverti/subscriptions","organizations_url":"https://api.github.com/users/miguelcleverti/orgs","repos_url":"https://api.github.com/users/miguelcleverti/repos","events_url":"https://api.github.com/users/miguelcleverti/events{/privacy}","received_events_url":"https://api.github.com/users/miguelcleverti/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T15:21:31Z","updated_at":"2016-02-04T15:21:31Z","body":"@bdunogier I guess you are right! I will close this PR then."}}