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)
4444
4545 ob_start ();
4646 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 );
4750 $ this ->container ->getByType ('Nette\Application\Application ' )->run ();
4851 } catch (\Exception $ e ) {
4952 ob_end_clean ();
@@ -53,7 +56,7 @@ public function doRequest($request)
5356 $ content = ob_get_clean ();
5457
5558 $ 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 ();
5760 $ headers = $ httpResponse ->getHeaders ();
5861
5962 $ repsonse = new Response ($ content , $ code , $ headers );
You can’t perform that action at this time.
0 commit comments