Skip to content

Commit 8f17d48

Browse files
committed
Allow running session tests in parallel
Use unique session IDs and/or save paths. Also removes the annoying order-dependence of session tests.
1 parent 09f4f30 commit 8f17d48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+266
-252
lines changed

ext/session/tests/003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class foo {
1717
function method() { $this->yes++; }
1818
}
1919

20-
session_id("abtest");
20+
session_id("test003");
2121
session_start();
2222
session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}');
2323

ext/session/tests/004.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class foo {
5555

5656
session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc"));
5757

58-
session_id("abtest");
58+
session_id("test004");
5959
session_start();
6060
$_SESSION["baz"]->method();
6161
$_SESSION["arr"][3]->method();
@@ -75,7 +75,7 @@ session_destroy();
7575
?>
7676
--EXPECT--
7777
OPEN: PHPSESSID
78-
READ: abtest
78+
READ: test004
7979
object(foo)#2 (2) {
8080
["bar"]=>
8181
string(2) "ok"
@@ -91,9 +91,9 @@ array(1) {
9191
int(2)
9292
}
9393
}
94-
WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
94+
WRITE: test004, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
9595
OPEN: PHPSESSID
96-
READ: abtest
96+
READ: test004
9797
object(foo)#3 (2) {
9898
["bar"]=>
9999
string(2) "ok"
@@ -109,4 +109,4 @@ array(1) {
109109
int(2)
110110
}
111111
}
112-
DESTROY: abtest
112+
DESTROY: test004

ext/session/tests/005.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class foo {
5656

5757
session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc"));
5858

59-
session_id("abtest");
59+
session_id("test005");
6060
session_start();
6161
session_decode($hnd->data);
6262

@@ -91,7 +91,7 @@ session_destroy();
9191
?>
9292
--EXPECT--
9393
OPEN: PHPSESSID
94-
READ: abtest
94+
READ: test005
9595
object(foo)#4 (2) {
9696
["bar"]=>
9797
string(2) "ok"
@@ -107,10 +107,10 @@ array(1) {
107107
int(2)
108108
}
109109
}
110-
WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
110+
WRITE: test005, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
111111
CLOSE
112112
OPEN: PHPSESSID
113-
READ: abtest
113+
READ: test005
114114
object(foo)#2 (2) {
115115
["bar"]=>
116116
string(2) "ok"
@@ -127,10 +127,10 @@ array(1) {
127127
}
128128
}
129129
int(123)
130-
WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}}c|i:123;
130+
WRITE: test005, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}}c|i:123;
131131
CLOSE
132132
OPEN: PHPSESSID
133-
READ: abtest
133+
READ: test005
134134
object(foo)#4 (2) {
135135
["bar"]=>
136136
string(2) "ok"
@@ -147,5 +147,5 @@ array(1) {
147147
}
148148
}
149149
int(123)
150-
DESTROY: abtest
150+
DESTROY: test005
151151
CLOSE

ext/session/tests/006.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ session.save_handler=files
1313
error_reporting(E_ALL);
1414
ob_start();
1515

16-
session_id("abtest");
16+
session_id("test006");
1717
session_start();
1818

1919
class a {

ext/session/tests/009.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ session.save_handler=files
1313
error_reporting(E_ALL);
1414
ob_start();
1515

16-
session_id("abtest");
16+
session_id("test009");
1717

1818
### Phase 1 cleanup
1919
session_start();
2020
session_destroy();
2121

2222
### Phase 2 $_SESSION["c"] does not contain any value
23-
session_id("abtest");
23+
session_id("test009");
2424
session_start();
2525
var_dump($_SESSION);
2626
$_SESSION["name"] = "foo";

ext/session/tests/012.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error_reporting(E_ALL);
1414

1515
### Absurd example, value of $_SESSION does not matter
1616

17-
session_id("abtest");
17+
session_id("test012");
1818
session_start();
1919
$_SESSION["_SESSION"] = Array();
2020
$_SESSION = "kk";

ext/session/tests/013.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ session.save_handler=files
1212
<?php
1313
error_reporting(E_ALL);
1414

15-
session_id("abtest");
15+
session_id("test013");
1616
session_start();
1717
session_destroy();
18-
session_id("abtest2");
18+
session_id("test013-2");
1919
session_start();
2020
session_destroy();
2121

ext/session/tests/014.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ session.save_handler=files
1414
<?php
1515
error_reporting(E_ALL);
1616

17-
session_id("abtest");
17+
session_id("test014");
1818
session_start();
1919

2020
?>

ext/session/tests/015.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ session.save_handler=files
1616
<?php
1717
error_reporting(E_ALL);
1818

19-
session_id("abtest");
19+
session_id("test015");
2020
session_start();
2121
?>
2222
<a href="/link?<?php echo SID; ?>">
2323
<?php
2424
session_destroy();
2525
?>
2626
--EXPECT--
27-
<a href="/link?PHPSESSID=abtest&PHPSESSID=abtest">
27+
<a href="/link?PHPSESSID=test015&PHPSESSID=test015">

ext/session/tests/018.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ session.save_handler=files
1616

1717
error_reporting(E_ALL);
1818

19-
session_id("abtest");
19+
session_id("test018");
2020
session_start();
2121
?>
2222
<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php>
2323
<?php
2424
session_destroy();
2525
?>
2626
--EXPECT--
27-
<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php><input type="hidden" name="PHPSESSID" value="abtest" />
27+
<form accept-charset="ISO-8859-15, ISO-8859-1" action=url.php><input type="hidden" name="PHPSESSID" value="test018" />

0 commit comments

Comments
 (0)