File tree Expand file tree Collapse file tree 5 files changed +27
-15
lines changed Expand file tree Collapse file tree 5 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ All notable changes of the PHPUnit 7.4 release series are documented in this fil
7
7
### Fixed
8
8
9
9
* Fixed [ #3379 ] ( https://github.com/sebastianbergmann/phpunit/issues/3379 ) : Dependent test of skipped test has status ` -1 `
10
+ * Fixed [ #3394 ] ( https://github.com/sebastianbergmann/phpunit/issues/3394 ) : Process Isolation does not work when PHPUnit is used as PHAR
10
11
11
12
## [ 7.4.3] - 2018-10-23
12
13
Original file line number Diff line number Diff line change 120
120
</exec >
121
121
</target >
122
122
123
- <target name =" phar" depends =" -phar-determine-version ,-phar-prepare " description =" Create PHAR archive of PHPUnit and all its dependencies" >
123
+ <target name =" phar" depends =" -phar-prepare ,-phar-determine-version " description =" Create PHAR archive of PHPUnit and all its dependencies" >
124
124
<antcall target =" -phar-build" >
125
125
<param name =" type" value =" release" />
126
126
</antcall >
Original file line number Diff line number Diff line change @@ -40,18 +40,16 @@ Phar::mapPhar('___PHAR___');
40
40
41
41
___FILELIST___
42
42
43
- if (!$ execute ) {
44
- exit ;
45
- }
46
-
47
- if (isset ($ printManifest )) {
48
- print file_get_contents (__PHPUNIT_PHAR_ROOT__ . '/manifest.txt ' );
43
+ if ($ execute ) {
44
+ if (isset ($ printManifest )) {
45
+ print file_get_contents (__PHPUNIT_PHAR_ROOT__ . '/manifest.txt ' );
49
46
50
- exit ;
51
- }
47
+ exit ;
48
+ }
52
49
53
- unset($ execute );
50
+ unset($ execute );
54
51
55
- PHPUnit \TextUI \Command::main ();
52
+ PHPUnit \TextUI \Command::main ();
53
+ }
56
54
57
55
__HALT_COMPILER ();
Original file line number Diff line number Diff line change @@ -686,11 +686,9 @@ public function run(TestResult $result = null): TestResult
686
686
return $ result ;
687
687
}
688
688
689
- $ runEntireClass = $ this ->runClassInSeparateProcess && !$ this ->runTestInSeparateProcess ;
689
+ if ($ this ->runInSeparateProcess ()) {
690
+ $ runEntireClass = $ this ->runClassInSeparateProcess && !$ this ->runTestInSeparateProcess ;
690
691
691
- if (($ this ->runTestInSeparateProcess === true || $ this ->runClassInSeparateProcess === true ) &&
692
- $ this ->inIsolation !== true &&
693
- !$ this instanceof PhptTestCase) {
694
692
$ class = new ReflectionClass ($ this );
695
693
696
694
if ($ runEntireClass ) {
@@ -2113,4 +2111,10 @@ private function checkExceptionExpectations(Throwable $throwable): bool
2113
2111
2114
2112
return $ result ;
2115
2113
}
2114
+
2115
+ private function runInSeparateProcess (): bool
2116
+ {
2117
+ return ($ this ->runTestInSeparateProcess === true || $ this ->runClassInSeparateProcess === true ) &&
2118
+ $ this ->inIsolation !== true && !$ this instanceof PhptTestCase;
2119
+ }
2116
2120
}
Original file line number Diff line number Diff line change 10
10
namespace PHPUnit \Util ;
11
11
12
12
use PharIo \Version \VersionConstraintParser ;
13
+ use PHPUnit \Framework \Assert ;
13
14
use PHPUnit \Framework \CodeCoverageException ;
14
15
use PHPUnit \Framework \Exception ;
15
16
use PHPUnit \Framework \InvalidCoversTargetException ;
@@ -706,6 +707,14 @@ public static function getHookMethods(string $className): array
706
707
$ class = new ReflectionClass ($ className );
707
708
708
709
foreach ($ class ->getMethods () as $ method ) {
710
+ if ($ method ->getDeclaringClass ()->getName () === Assert::class) {
711
+ continue ;
712
+ }
713
+
714
+ if ($ method ->getDeclaringClass ()->getName () === TestCase::class) {
715
+ continue ;
716
+ }
717
+
709
718
if (self ::isBeforeClassMethod ($ method )) {
710
719
\array_unshift (
711
720
self ::$ hookMethods [$ className ]['beforeClass ' ],
You can’t perform that action at this time.
0 commit comments