{"action":"closed","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/2035","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/2035/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/2035/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/2035/events","html_url":"https://github.com/yiisoft/yii2/issues/2035","id":25855582,"number":2035,"title":"Document fixtures usage in basic and advanced app tests","user":{"login":"Ragazzo","id":1748844,"avatar_url":"https://avatars.githubusercontent.com/u/1748844?v=3","gravatar_id":"","url":"https://api.github.com/users/Ragazzo","html_url":"https://github.com/Ragazzo","followers_url":"https://api.github.com/users/Ragazzo/followers","following_url":"https://api.github.com/users/Ragazzo/following{/other_user}","gists_url":"https://api.github.com/users/Ragazzo/gists{/gist_id}","starred_url":"https://api.github.com/users/Ragazzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ragazzo/subscriptions","organizations_url":"https://api.github.com/users/Ragazzo/orgs","repos_url":"https://api.github.com/users/Ragazzo/repos","events_url":"https://api.github.com/users/Ragazzo/events{/privacy}","received_events_url":"https://api.github.com/users/Ragazzo/received_events","type":"User","site_admin":false},"labels":[{"id":33208865,"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:docs","name":"type:docs","color":"207de5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/9","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.x","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/9/labels","id":831720,"number":9,"title":"2.0.x","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":404,"closed_issues":4,"state":"open","created_at":"2014-10-19T13:49:45Z","updated_at":"2016-10-29T15:57:24Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2014-01-18T06:50:18Z","updated_at":"2016-10-29T15:57:24Z","closed_at":"2016-10-29T15:57:24Z","body":"This issue is based on p1 of [this](https://github.com/yiisoft/yii2/issues/1956#issuecomment-32638755) comment:\n\n> For codeception tests, should we need to develop a base test class which has the fixture management feature like the unit test class? How do functional tests make use of fixtures?\n\n@DavertMik said:\n\n> @Ragazzo @qiangxue Sure, fixtures can be applied to any tests. And the test-dump is not the one and not the best choice. \n> \n> As I see usage of AR in functional tests may look like:\n> \n> ``` php\n> $user_id = $I->haveRecord('User', array('name' => 'Yii'));\n> $I->haveRecord('Category', array('name' => 'Testing')');\n> ```\n> \n> This can be improved to use fixtures as well:\n> \n> ``` php\n> $I->haveFixture('UserProfile', 'user1');\n> ```\n> \n> And yes, it means that Yii2 module should handle AR interactions as well. So it would allow testing the database as well as responses.\n> \n> Also I think fixture trait may be used in Helper classes and Group classes. Something like, to load a common set of fixtures for a specific group of tests.\n\n@Ragazzo said:\n\n> as for @DavertMik approach, i would rather vote for second:\n> $I->grabFixture('UserProfile', 'user1');\n> \n> Need more thinking here of course.\n"}}
{"actor":{"display_login":"dynasource"}}