Skip to content

Commit

Permalink
Check for requirements before creating a separate process
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
  • Loading branch information
MauricioFauth committed Sep 26, 2024
1 parent 5f53b1f commit 0858a4b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ final public function run(): void
return;
}

if (!$this->shouldRunInSeparateProcess()) {
if (!$this->shouldRunInSeparateProcess() || (new Requirements)->requirementsNotSatisfiedFor(static::class, $this->name) !== []) {
(new TestRunner)->run($this);
} else {
(new TestRunner)->runInSeparateProcess(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

SS 2 / 2 (100%)

Time: %s, Memory: %s

An error occurred inside PHPUnit.

Message: Call to undefined function proc_open()
Location: %s:%d

%a
OK, but some tests were skipped!
Tests: 2, Assertions: 0, Skipped: 2.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

SS 2 / 2 (100%)

Time: %s, Memory: %s

An error occurred inside PHPUnit.

Message: Call to undefined function proc_open()
Location: %s:%d

%a
OK, but some tests were skipped!
Tests: 2, Assertions: 0, Skipped: 2.
10 changes: 4 additions & 6 deletions tests/end-to-end/regression/4391-separate-requires-in-class.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

S 1 / 1 (100%)

Time: %s, Memory: %s

An error occurred inside PHPUnit.

Message: Call to undefined function proc_open()
Location: %s:%d

%a
OK, but some tests were skipped!
Tests: 1, Assertions: 0, Skipped: 1.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

S 1 / 1 (100%)

Time: %s, Memory: %s

An error occurred inside PHPUnit.

Message: Call to undefined function proc_open()
Location: %s:%d

%a
OK, but some tests were skipped!
Tests: 1, Assertions: 0, Skipped: 1.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

SS 2 / 2 (100%)

Time: %s, Memory: %s

An error occurred inside PHPUnit.

Message: Call to undefined function proc_open()
Location: %s:%d

%a
OK, but some tests were skipped!
Tests: 2, Assertions: 0, Skipped: 2.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

SS 2 / 2 (100%)

Time: %s, Memory: %s

An error occurred inside PHPUnit.

Message: Call to undefined function proc_open()
Location: %s:%d

%a
OK, but some tests were skipped!
Tests: 2, Assertions: 0, Skipped: 2.

0 comments on commit 0858a4b

Please sign in to comment.