{"action":"created","issue":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/4894","repository_url":"https://api.github.com/repos/Codeception/Codeception","labels_url":"https://api.github.com/repos/Codeception/Codeception/issues/4894/labels{/name}","comments_url":"https://api.github.com/repos/Codeception/Codeception/issues/4894/comments","events_url":"https://api.github.com/repos/Codeception/Codeception/issues/4894/events","html_url":"https://github.com/Codeception/Codeception/pull/4894","id":309643670,"number":4894,"title":"Yii2 rework, new PR same changes.","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars1.githubusercontent.com/u/547021?v=4","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"labels":[{"id":31385312,"url":"https://api.github.com/repos/Codeception/Codeception/labels/Yii","name":"Yii","color":"bdc3c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2018-03-29T07:12:06Z","updated_at":"2018-05-03T09:27:29Z","closed_at":"2018-03-31T20:33:03Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Codeception/Codeception/pulls/4894","html_url":"https://github.com/Codeception/Codeception/pull/4894","diff_url":"https://github.com/Codeception/Codeception/pull/4894.diff","patch_url":"https://github.com/Codeception/Codeception/pull/4894.patch"},"body":"- No more static variables\r\n- No more database connection caching (that didn't actually work)\r\n- Support for multiple database connections / database services with names other than 'db'\r\n\r\nThis needs more testing; I've tested it in a few of my production apps.\r\n\r\nAlso somewhere in the docs we should update the \"contract\" about application state:\r\n\r\n1. When a test starts you get a fresh application.\r\n2. Just before a request is executed the `Request` and `Response` component are reloaded.\r\n3. Application state is persisted after the request and reused for the next request (as long as it is not in the `Request` or `Response` component.\r\n4. All PDO based connections are supported as long as they are subclasses of `yii\\db\\Connection` and fire the `AFTER_OPEN` event.\r\n\r\n\r\nDatabase handling (for transactions)\r\n\r\n1. All caches are cleared at the end of a test.\r\n2. At the start of a test we register an event handler for `AFTER_OPEN`.\r\n3. When the event is fired we generate a cache key based on connection settings.\r\n4. We store the PDO object in the cache.\r\n5. We store an entry in the dsn cache, this is used to identify unsupported cases (think connecting to the same database with different credentials, in which case the transaction creates 2 world views which could cause issues).\r\n6. If we detect a duplicate PDO object we replace the new PDO with the existing one, this causes the new connection to be closed immediately and guarantees us that the new `Connection` object uses the same PDO object and thus has the same world view.\r\n"},"comment":{"url":"https://api.github.com/repos/Codeception/Codeception/issues/comments/386238568","html_url":"https://github.com/Codeception/Codeception/pull/4894#issuecomment-386238568","issue_url":"https://api.github.com/repos/Codeception/Codeception/issues/4894","id":386238568,"user":{"login":"Slamdunk","id":152236,"avatar_url":"https://avatars0.githubusercontent.com/u/152236?v=4","gravatar_id":"","url":"https://api.github.com/users/Slamdunk","html_url":"https://github.com/Slamdunk","followers_url":"https://api.github.com/users/Slamdunk/followers","following_url":"https://api.github.com/users/Slamdunk/following{/other_user}","gists_url":"https://api.github.com/users/Slamdunk/gists{/gist_id}","starred_url":"https://api.github.com/users/Slamdunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slamdunk/subscriptions","organizations_url":"https://api.github.com/users/Slamdunk/orgs","repos_url":"https://api.github.com/users/Slamdunk/repos","events_url":"https://api.github.com/users/Slamdunk/events{/privacy}","received_events_url":"https://api.github.com/users/Slamdunk/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T09:27:29Z","updated_at":"2018-05-03T09:27:29Z","author_association":"CONTRIBUTOR","body":"@samdark @DavertMik please stop releasing BC breaks as bugfix. This PR completely changes the API of the involved classes and should have been tagged in 3.0.0.\r\n\r\nSemver is not a joke, I had to drop each and every multiple range version constraint described in [composer doc](https://getcomposer.org/doc/articles/versions.md) because the projects you maintain just ignore completely https://semver.org/"}}
{"actor":{"display_login":"Slamdunk"}}