Skip to content

Commit f2caa8c

Browse files
erickskrauchsamdark
authored andcommitted
Perform Yii2 application reset before performing request in functional tests (#4651)
* Reset Yii2 application before perform request * Reverting previous solution and replacing it with recreated Yii2 Request object * Recreating Yii2 request object with original component's configuration
1 parent 006e14b commit f2caa8c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public function doRequest($request)
135135

136136
ob_start();
137137

138+
// recreating request object to reset headers and cookies collections
139+
$app->set('request', $app->getComponents()['request']);
138140
$yiiRequest = $app->getRequest();
139141
if ($request->getContent() !== null) {
140142
$yiiRequest->setRawBody($request->getContent());

0 commit comments

Comments
 (0)