Skip to content

Commit ad9a61a

Browse files
committed
Merge branch '2.2' into merge-2.2-to-master
2 parents 6ae5468 + 5674938 commit ad9a61a

24 files changed

+456
-5
lines changed

src/Codeception/Module/PhpBrowser.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22
namespace Codeception\Module;
33

4-
use Codeception\Exception\ModuleConfigException;
5-
use Codeception\Exception\ModuleException;
64
use Codeception\Lib\Connector\Guzzle6;
75
use Codeception\Lib\InnerBrowser;
86
use Codeception\Lib\Interfaces\MultiSession;
@@ -131,7 +129,6 @@ public function _requires()
131129

132130
public function _initialize()
133131
{
134-
$this->client = $this->guessGuzzleConnector();
135132
$this->_initializeSession();
136133
}
137134

@@ -150,7 +147,7 @@ public function _before(TestInterface $test)
150147
if (!$this->client) {
151148
$this->client = $this->guessGuzzleConnector();
152149
}
153-
$this->_initializeSession();
150+
$this->_prepareSession();
154151
}
155152

156153
public function _getUrl()
@@ -193,7 +190,7 @@ public function amOnSubdomain($subdomain)
193190

194191
protected function onReconfigure()
195192
{
196-
$this->_initializeSession();
193+
$this->_prepareSession();
197194
}
198195

199196
/**
@@ -227,6 +224,13 @@ public function _getResponseCode()
227224
}
228225

229226
public function _initializeSession()
227+
{
228+
// independent sessions need independent cookies
229+
$this->client = $this->guessGuzzleConnector();
230+
$this->_prepareSession();
231+
}
232+
233+
public function _prepareSession()
230234
{
231235
$defaults = array_intersect_key($this->config, array_flip($this->guzzleConfigFields));
232236
$curlOptions = [];

tests/data/app/controllers.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ function GET($matches) {
162162

163163
class form {
164164
function GET($matches) {
165+
data::set('query', $_GET);
165166
$url = strtolower($matches[1]);
166167
if (empty($matches[1])) {
167168
$url = 'index';
@@ -246,3 +247,15 @@ function GET() {
246247
header('Set-Cookie: a=; Expires=Thu, 01 Jan 1970 00:00:01 GMT');
247248
}
248249
}
250+
251+
class basehref {
252+
function GET() {
253+
include __DIR__.'/view/basehref.php';
254+
}
255+
}
256+
257+
class jserroronload {
258+
function GET() {
259+
include __DIR__.'/view/jserroronload.php';
260+
}
261+
}

tests/data/app/hhvm-server.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
hhvm.server.port = 8000
2+
hhvm.server.type = proxygen
3+
hhvm.server.default_document = index.php
4+
hhvm.server.error_document404 = index.php
5+
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
6+
hhvm.log.use_log_file = false
7+
hhvm.hack.lang.auto_typecheck=0
8+
hhvm.hack.lang.look_for_typechecker=0

tests/data/app/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
'/unset-cookie' => 'unsetCookie',
4646
'/external_url' => 'external_url',
4747
'/iframe' => 'iframe',
48+
'/basehref' => 'basehref',
49+
'/jserroronload' => 'jserroronload'
4850
);
4951

5052
glue::stick($urls);

tests/data/app/view/basehref.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5+
</head>
6+
<body>
7+
8+
<base href="/form/">
9+
10+
<p>
11+
<a href="example7">Relative Link</a>
12+
</p>
13+
14+
15+
<form action="example5" method="post">
16+
<input type="text" name="rus" value="Верно"/>
17+
<input type="submit" value="Relative Form"/>
18+
</form>
19+
20+
</body>
21+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<html>
2+
<title>TestEd Beta 2.0</title>
3+
<body>
4+
5+
<h1>Welcome to test app!</h1>
6+
7+
<form action="#a" method="post">
8+
<input name="field1" />
9+
<input type="submit" value="Hash Form" />
10+
</form>
11+
12+
<a href="#b">Hash Link</a>
13+
14+
<a href="#c">
15+
<input type="submit" value="Hash Button" />
16+
</a>
17+
18+
19+
</body>
20+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html><body>
2+
3+
<form method="post">
4+
<select name="test">
5+
<option value="_none">- None -</option>
6+
</select>
7+
</form>
8+
9+
<?php
10+
if (isset($_POST['test']) && $_POST['test'] !== '_none') {
11+
echo 'ERROR';
12+
}
13+
?>
14+
15+
</body></html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<html><body>
2+
3+
<a href="/">222</a>
4+
</body></html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>grabValueFrom issue</title>
6+
</head>
7+
<body>
8+
<form method="get">
9+
<input type="text" name="empty" id="empty">
10+
<textarea name="empty_textarea" id="empty_textarea"></textarea>
11+
<textarea name="textarea[name][]" id="textarea_with_square_bracket"></textarea>
12+
</form>
13+
</body>
14+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>issue #3983</title>
6+
</head>
7+
<body>
8+
<form method="get" action="/form/bug3953">
9+
<select name="select_name" id="select_id">
10+
<option value="one">first</option>
11+
<option value="two">second</option>
12+
</select>
13+
<input type="text" name="search_name">
14+
<button>Submit</button>
15+
</form>
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)