File tree 2 files changed +41
-0
lines changed
tests/end-to-end/regression/GitHub/3258
2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -686,16 +686,19 @@ public function run(TestResult $result = null): TestResult
686
686
return $ result ;
687
687
}
688
688
689
+ print "## check: TestCase->runInSeperateProcess() \n" ;
689
690
if ($ this ->runInSeparateProcess ()) {
690
691
$ runEntireClass = $ this ->runClassInSeparateProcess && !$ this ->runTestInSeparateProcess ;
691
692
692
693
$ class = new ReflectionClass ($ this );
693
694
694
695
if ($ runEntireClass ) {
696
+ print "## @runClassInSeperateProcess \n" ;
695
697
$ template = new Text_Template (
696
698
__DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl '
697
699
);
698
700
} else {
701
+ print "## @runInSeperateProcess \n" ;
699
702
$ template = new Text_Template (
700
703
__DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl '
701
704
);
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /*
3
+ * This file is part of PHPUnit.
4
+ *
5
+ * (c) Sebastian Bergmann <[email protected] >
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+
11
+ /**
12
+ * @preserveGlobalState
13
+ * @runClassInSeperateProcess
14
+ */
15
+ class Issue3258Test extends \PHPUnit \Framework \TestCase
16
+ {
17
+ protected $ internalCounter = 0 ;
18
+
19
+ /**
20
+ */
21
+ public function testVerifyUntouchedStartStateThenUpdateState ()
22
+ {
23
+ $ this ->assertSame (0 , $ this ->internalCounter );
24
+ $ this ->assertArrayNotHasKey ('Issue3258_test_global ' , $ GLOBALS );
25
+
26
+ $ this ->internalCounter ++;
27
+ $ GLOBALS ['Issue3258_test_global ' ] = true ;
28
+ }
29
+
30
+ /**
31
+ * @depends testVerifyUntouchedStartStateThenUpdateState
32
+ */
33
+ public function testStateHasBeenKeptBetweenTests ()
34
+ {
35
+ $ this ->assertSame (1 , $ this ->internalCounter );
36
+ $ this ->assertSame (true , $ GLOBALS ['Issue3258_test_global ' ]);
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments