{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/5814","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/5814/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/5814/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/5814/events","html_url":"https://github.com/cakephp/cakephp/pull/5814","id":56227673,"number":5814,"title":"3.0: IntegrationTestCase::assertResponseOk()","user":{"login":"dereuromark","id":39854,"avatar_url":"https://avatars.githubusercontent.com/u/39854?v=3","gravatar_id":"","url":"https://api.github.com/users/dereuromark","html_url":"https://github.com/dereuromark","followers_url":"https://api.github.com/users/dereuromark/followers","following_url":"https://api.github.com/users/dereuromark/following{/other_user}","gists_url":"https://api.github.com/users/dereuromark/gists{/gist_id}","starred_url":"https://api.github.com/users/dereuromark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dereuromark/subscriptions","organizations_url":"https://api.github.com/users/dereuromark/orgs","repos_url":"https://api.github.com/users/dereuromark/repos","events_url":"https://api.github.com/users/dereuromark/events{/privacy}","received_events_url":"https://api.github.com/users/dereuromark/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Enhancement","name":"Enhancement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/7","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/7/labels","id":453043,"number":7,"title":"3.0.0","description":"New major release that breaks compatibility with 2.x\r\n\r\n- PHP5.4.19+\r\n- New ORM & behaviors.\r\n- Improved Routing\r\n- PSR-0 and composer support.\r\n- Simpler configuration and bootstrapping.\r\n- Improved configuration handling.\r\n- Improved bake.\r\n\r\nSee [the roadmap](http://github.com/cakephp/cakephp/wiki/3.0-roadmap) for more details.","creator":{"login":"lh-import","id":5175817,"avatar_url":"https://avatars.githubusercontent.com/u/5175817?v=3","gravatar_id":"","url":"https://api.github.com/users/lh-import","html_url":"https://github.com/lh-import","followers_url":"https://api.github.com/users/lh-import/followers","following_url":"https://api.github.com/users/lh-import/following{/other_user}","gists_url":"https://api.github.com/users/lh-import/gists{/gist_id}","starred_url":"https://api.github.com/users/lh-import/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lh-import/subscriptions","organizations_url":"https://api.github.com/users/lh-import/orgs","repos_url":"https://api.github.com/users/lh-import/repos","events_url":"https://api.github.com/users/lh-import/events{/privacy}","received_events_url":"https://api.github.com/users/lh-import/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":2250,"state":"open","created_at":"2013-10-11T20:56:23Z","updated_at":"2015-02-02T19:38:17Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-02-02T11:57:46Z","updated_at":"2015-02-02T20:58:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/5814","html_url":"https://github.com/cakephp/cakephp/pull/5814","diff_url":"https://github.com/cakephp/cakephp/pull/5814.diff","patch_url":"https://github.com/cakephp/cakephp/pull/5814.patch"},"body":"With the recent changes to properly assert 302 instead of 200 for redirects `assertResponseOk()` should also apply to 3xx as it then feels consistent:\r\n\r\n- OK: 2xx/3xx\r\n- ERROR: 4xx\r\n- FAIL: 5xx\r\n\r\nWe currently had the case that a simple 302 redirect broke the `assertResponseOk()` assert.\r\nWhich would still not be a fail or error and as such is (the only remaining alternative) \"ok\" IMO. \r\nFor anything more specific one should use the direct asserts for status codes, `assertResponseCode($code)`."},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/72536427","html_url":"https://github.com/cakephp/cakephp/pull/5814#issuecomment-72536427","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/5814","id":72536427,"user":{"login":"jadb","id":33527,"avatar_url":"https://avatars.githubusercontent.com/u/33527?v=3","gravatar_id":"","url":"https://api.github.com/users/jadb","html_url":"https://github.com/jadb","followers_url":"https://api.github.com/users/jadb/followers","following_url":"https://api.github.com/users/jadb/following{/other_user}","gists_url":"https://api.github.com/users/jadb/gists{/gist_id}","starred_url":"https://api.github.com/users/jadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadb/subscriptions","organizations_url":"https://api.github.com/users/jadb/orgs","repos_url":"https://api.github.com/users/jadb/repos","events_url":"https://api.github.com/users/jadb/events{/privacy}","received_events_url":"https://api.github.com/users/jadb/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T20:58:58Z","updated_at":"2015-02-02T20:58:58Z","body":"I think like @lorenzo on this one. Ok is 2xx and (at least for me) would break some tests because 3xx is not supposed to be `ok` (i.e. unauthorized request redirected to login page).\r\n\r\nOn anohter note, here's how I've been checking for redirects:\r\n\r\n```php\r\n$this->assertResponseOk(); // did result in a 2xx code at the end\r\n$this->assertRedirect(...); // did so after following a redirect\r\n```"}}