1
1
<?php
2
2
namespace Codeception \Module ;
3
3
4
- use Codeception \Exception \ModuleConfigException ;
5
- use Codeception \Exception \ModuleException ;
6
4
use Codeception \Lib \Connector \Guzzle6 ;
7
5
use Codeception \Lib \InnerBrowser ;
8
6
use Codeception \Lib \Interfaces \MultiSession ;
@@ -131,7 +129,6 @@ public function _requires()
131
129
132
130
public function _initialize ()
133
131
{
134
- $ this ->client = $ this ->guessGuzzleConnector ();
135
132
$ this ->_initializeSession ();
136
133
}
137
134
@@ -150,7 +147,7 @@ public function _before(TestInterface $test)
150
147
if (!$ this ->client ) {
151
148
$ this ->client = $ this ->guessGuzzleConnector ();
152
149
}
153
- $ this ->_initializeSession ();
150
+ $ this ->_prepareSession ();
154
151
}
155
152
156
153
public function _getUrl ()
@@ -193,7 +190,7 @@ public function amOnSubdomain($subdomain)
193
190
194
191
protected function onReconfigure ()
195
192
{
196
- $ this ->_initializeSession ();
193
+ $ this ->_prepareSession ();
197
194
}
198
195
199
196
/**
@@ -227,6 +224,13 @@ public function _getResponseCode()
227
224
}
228
225
229
226
public function _initializeSession ()
227
+ {
228
+ // independent sessions need independent cookies
229
+ $ this ->client = $ this ->guessGuzzleConnector ();
230
+ $ this ->_prepareSession ();
231
+ }
232
+
233
+ public function _prepareSession ()
230
234
{
231
235
$ defaults = array_intersect_key ($ this ->config , array_flip ($ this ->guzzleConfigFields ));
232
236
$ curlOptions = [];
0 commit comments