Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Sep 9, 2024
1 parent 9b77286 commit 02a3246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ parameters:
count: 1
path: src/Options.php

-
message: "#^Call to an undefined method PHPUnit\\\\Metadata\\\\Api\\\\CodeCoverage\\:\\:linesToBeIgnored\\(\\)\\.$#"
count: 1
path: src/WrapperRunner/ApplicationForWrapperWorker.php

-
message: "#^Call to an undefined method PHPUnit\\\\Runner\\\\Filter\\\\Factory\\:\\:addNameFilter\\(\\)\\.$#"
count: 1
path: src/WrapperRunner/ApplicationForWrapperWorker.php

-
message: "#^Match expression does not handle remaining value\\: string$#"
count: 1
Expand Down
20 changes: 6 additions & 14 deletions src/WrapperRunner/ApplicationForWrapperWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use PHPUnit\Runner\Filter\Factory;
use PHPUnit\Runner\TestSuiteLoader;
use PHPUnit\Runner\TestSuiteSorter;
use PHPUnit\Runner\Version;
use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade;
use PHPUnit\TextUI\Configuration\Builder;
use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry;
Expand All @@ -41,7 +40,6 @@
use function str_ends_with;
use function strpos;
use function substr;
use function version_compare;

/**
* @internal
Expand Down Expand Up @@ -75,11 +73,7 @@ public function runTest(string $testPath): int
$filter = new Factory();
$name = substr($testPath, $null + 1);
assert($name !== '');
if (version_compare(Version::id(), '11.0.0') >= 0) {
$filter->addIncludeNameFilter($name);
} else {
$filter->addNameFilter($name);
}
$filter->addNameFilter($name);

$testPath = substr($testPath, 0, $null);
}
Expand All @@ -94,12 +88,10 @@ public function runTest(string $testPath): int
$testSuite = TestSuite::fromClassReflector($testSuiteRefl);
}

if (version_compare(Version::id(), '11.0.0') < 0) {
if (CodeCoverage::instance()->isActive()) {
CodeCoverage::instance()->ignoreLines(
(new CodeCoverageMetadataApi())->linesToBeIgnored($testSuite),
);
}
if (CodeCoverage::instance()->isActive()) {
CodeCoverage::instance()->ignoreLines(
(new CodeCoverageMetadataApi())->linesToBeIgnored($testSuite),
);
}

(new TestSuiteFilterProcessor())->process($this->configuration, $testSuite);
Expand Down Expand Up @@ -234,7 +226,7 @@ public function end(): void
assert(isset($this->testdoxFile));
assert(isset($this->testdoxColumns));

(new TestDoxResultPrinter(DefaultPrinter::from($this->testdoxFile), $this->testdoxColor, $this->testdoxColumns))->print(
(new TestDoxResultPrinter(DefaultPrinter::from($this->testdoxFile), $this->testdoxColor))->print(
$this->testdoxResultCollector->testMethodsGroupedByClass(),
);
}
Expand Down

0 comments on commit 02a3246

Please sign in to comment.