Skip to content

Commit cfd938d

Browse files
MauricioFauthsebastianbergmann
authored andcommitted
Check for requirements before creating a separate process
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
1 parent 1df009d commit cfd938d

7 files changed

+25
-37
lines changed

src/Framework/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ final public function run(): void
513513
return;
514514
}
515515

516-
if (!$this->shouldRunInSeparateProcess()) {
516+
if (!$this->shouldRunInSeparateProcess() || (new Requirements)->requirementsNotSatisfiedFor(static::class, $this->name) !== []) {
517517
(new TestRunner)->run($this);
518518
} else {
519519
(new TestRunner)->runInSeparateProcess(

tests/end-to-end/regression/4391-separate-class-requires-in-class.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2323

2424
Runtime: %s
2525

26+
SS 2 / 2 (100%)
2627

28+
Time: %s, Memory: %s
2729

28-
An error occurred inside PHPUnit.
29-
30-
Message: Call to undefined function proc_open()
31-
Location: %s:%d
32-
33-
%a
30+
OK, but some tests were skipped!
31+
Tests: 2, Assertions: 0, Skipped: 2.

tests/end-to-end/regression/4391-separate-class-requires-in-method.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2323

2424
Runtime: %s
2525

26+
SS 2 / 2 (100%)
2627

28+
Time: %s, Memory: %s
2729

28-
An error occurred inside PHPUnit.
29-
30-
Message: Call to undefined function proc_open()
31-
Location: %s:%d
32-
33-
%a
30+
OK, but some tests were skipped!
31+
Tests: 2, Assertions: 0, Skipped: 2.

tests/end-to-end/regression/4391-separate-requires-in-class.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2323

2424
Runtime: %s
2525

26+
S 1 / 1 (100%)
2627

28+
Time: %s, Memory: %s
2729

28-
An error occurred inside PHPUnit.
29-
30-
Message: Call to undefined function proc_open()
31-
Location: %s:%d
32-
33-
%a
30+
OK, but some tests were skipped!
31+
Tests: 1, Assertions: 0, Skipped: 1.

tests/end-to-end/regression/4391-separate-requires-in-method.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2323

2424
Runtime: %s
2525

26+
S 1 / 1 (100%)
2627

28+
Time: %s, Memory: %s
2729

28-
An error occurred inside PHPUnit.
29-
30-
Message: Call to undefined function proc_open()
31-
Location: %s:%d
32-
33-
%a
30+
OK, but some tests were skipped!
31+
Tests: 1, Assertions: 0, Skipped: 1.

tests/end-to-end/regression/4391-separate-tests-requires-in-class.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2323

2424
Runtime: %s
2525

26+
SS 2 / 2 (100%)
2627

28+
Time: %s, Memory: %s
2729

28-
An error occurred inside PHPUnit.
29-
30-
Message: Call to undefined function proc_open()
31-
Location: %s:%d
32-
33-
%a
30+
OK, but some tests were skipped!
31+
Tests: 2, Assertions: 0, Skipped: 2.

tests/end-to-end/regression/4391-separate-tests-requires-in-method.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2323

2424
Runtime: %s
2525

26+
SS 2 / 2 (100%)
2627

28+
Time: %s, Memory: %s
2729

28-
An error occurred inside PHPUnit.
29-
30-
Message: Call to undefined function proc_open()
31-
Location: %s:%d
32-
33-
%a
30+
OK, but some tests were skipped!
31+
Tests: 2, Assertions: 0, Skipped: 2.

0 commit comments

Comments
 (0)