File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/Codeception/Util/Connector Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ public function doRequest($request)
44
44
45
45
ob_start ();
46
46
try {
47
+ // The HTTP code from previous test sometimes survives in http_response_code() so it's necessary to reset it manually.
48
+ // @link https://github.com/nette/nette/pull/1263
49
+ $ this ->container ->getByType ('Nette\Http\IResponse ' )->setCode (IResponse::S200_OK );
47
50
$ this ->container ->getByType ('Nette\Application\Application ' )->run ();
48
51
} catch (\Exception $ e ) {
49
52
ob_end_clean ();
@@ -53,7 +56,7 @@ public function doRequest($request)
53
56
$ content = ob_get_clean ();
54
57
55
58
$ httpResponse = $ this ->container ->getByType ('Nette\Http\IResponse ' );
56
- $ code = $ httpResponse ->getCode () ?: IResponse:: S200_OK ; // @see https://github.com/nette/nette/issues/1263
59
+ $ code = $ httpResponse ->getCode ();
57
60
$ headers = $ httpResponse ->getHeaders ();
58
61
59
62
$ repsonse = new Response ($ content , $ code , $ headers );
You can’t perform that action at this time.
0 commit comments