{"action":"opened","issue":{"url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/15","labels_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/15/comments","events_url":"https://api.github.com/repos/yiisoft/yii2-app-advanced/issues/15/events","html_url":"https://github.com/yiisoft/yii2-app-advanced/issues/15","id":65179165,"number":15,"title":"Codeception tests & \\Yii::$container problem","user":{"login":"jarekkozak","id":5037528,"avatar_url":"https://avatars.githubusercontent.com/u/5037528?v=3","gravatar_id":"","url":"https://api.github.com/users/jarekkozak","html_url":"https://github.com/jarekkozak","followers_url":"https://api.github.com/users/jarekkozak/followers","following_url":"https://api.github.com/users/jarekkozak/following{/other_user}","gists_url":"https://api.github.com/users/jarekkozak/gists{/gist_id}","starred_url":"https://api.github.com/users/jarekkozak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarekkozak/subscriptions","organizations_url":"https://api.github.com/users/jarekkozak/orgs","repos_url":"https://api.github.com/users/jarekkozak/repos","events_url":"https://api.github.com/users/jarekkozak/events{/privacy}","received_events_url":"https://api.github.com/users/jarekkozak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-30T10:14:56Z","updated_at":"2015-03-30T10:14:56Z","closed_at":null,"body":"Hi,\r\nI found strange behavior during  tests execution.  I defined class implementation using \\Yii::$container like this:\r\n```\r\n\\Yii::$container->set('\\common\\src\\dict\\ICarOwnerDictionary','\\common\\src\\dict\\CarOwnerDictionary');\r\n```\r\nin\r\n```\r\n common/config/bootstrap.php\r\n```\r\neverything works ok until i try to run backend/functional tests. It is simple Cept test where I try to display page which gets dictionary implementation from \\Yii::$container and display entries.\r\n\r\nAnd there is the problem:\r\n1. If I run backend application works perfect (in browser).\r\n2. If I execute only functional test for backend - works fine\r\n3. If I execute the whole tests - does not work.  There is empty \\Yii:$container (debugged).\r\n\r\nI found workaround, simply move 'common' test execution at the end - in tests/codeception.yml like this\r\n```\r\ninclude:\r\n  - codeception/backend\r\n  - codeception/frontend\r\n  - codeception/console\r\n  - codeception/common\r\n\r\npaths:\r\n  log: codeception/_output\r\n\r\nsettings:\r\n  colors: true\r\n\r\n``` \r\nAfter this change works perfect. It looks like only general  _bootstrap file is executed once at the beginning and testing 'common' destroys \\Yii:$container.\r\n\r\nI spent a while (long while) and I only found above workaround, maybe I did something wrong? Any idea? \r\nRegards,\r\nJarek\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}