Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
php-versions: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]

steps:
# https://github.com/marketplace/actions/setup-php-action
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ext-simplexml": "*",
"ext-xmlreader": "*",
"phpunit/phpunit": "^10.3||^11.0||^12.0",
"symfony/console": "^5.4||^6.2||^7.0"
"symfony/console": "^5.4||^6.2||^7.0||^8.0"
},
"autoload": {
"psr-4": {
Expand All @@ -34,7 +34,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.9",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^2",
"spatie/phpunit-snapshot-assertions": "^5.0"
},
"config": {
Expand Down
1,353 changes: 856 additions & 497 deletions composer.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static function create(): self
*/
public function print(array $results, Duration $duration): void
{
/** @var non-empty-array<int> $statusWeights */
$statusWeights = array_map(fn (MinCoverageResult $result) => $result->getStatus()->getWeight(), $results);
$finalStatus = ResultStatus::fromWeight(max($statusWeights));

Expand Down
2 changes: 1 addition & 1 deletion src/PhpUnitExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function bootstrap(
if (!$subscriber = ApplicationFinishedSubscriber::fromConfigurationAndParameters(
configuration: $configuration,
parameters: $parameters,
args: $_SERVER['argv'],
args: $_SERVER['argv'], // @phpstan-ignore argument.type
)) {
return;
}
Expand Down
30 changes: 22 additions & 8 deletions tests/Subscriber/Application/ApplicationFinishedSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function testNotifyWithAtLeastOneFailedRule(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('Not all minimum code coverage rules', $this->output);
$this->assertStringContainsString('passed, please try again... :)', $this->output);
}

public function testNotifyWithAWarning(): void
Expand Down Expand Up @@ -109,7 +110,9 @@ public function testNotifyWithAWarning(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('There was at least one pattern that', $this->output);
$this->assertStringContainsString('did not match any covered classes.', $this->output);
$this->assertStringContainsString('Please consider removing them', $this->output);
}

public function testNotifyWhenCoverageIsOk(): void
Expand Down Expand Up @@ -143,7 +146,8 @@ public function testNotifyWhenCoverageIsOk(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('All minimum code coverage rules', $this->output);
$this->assertStringContainsString('passed, give yourself a pat on the', $this->output);
}

public function testNotifyWithOnlyTotal(): void
Expand Down Expand Up @@ -177,7 +181,9 @@ public function testNotifyWithOnlyTotal(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('Total', $this->output);
$this->assertStringContainsString('All minimum code coverage rules', $this->output);
$this->assertStringContainsString('passed, give yourself a pat on the', $this->output);
}

public function testNotifyWithoutTotal(): void
Expand Down Expand Up @@ -211,7 +217,9 @@ public function testNotifyWithoutTotal(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringNotContainsString('Total', $this->output);
$this->assertStringContainsString('All minimum code coverage rules', $this->output);
$this->assertStringContainsString('passed, give yourself a pat on the', $this->output);
}

public function testNotifyWithRulesThatDoNotExit(): void
Expand Down Expand Up @@ -245,7 +253,9 @@ public function testNotifyWithRulesThatDoNotExit(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('No', $this->output);
$this->assertStringContainsString('Not all minimum code coverage rules', $this->output);
$this->assertStringContainsString('passed, please try again... :)', $this->output);
}

public function testDivideByZero(): void
Expand Down Expand Up @@ -279,7 +289,9 @@ public function testDivideByZero(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('There was at least one pattern that', $this->output);
$this->assertStringContainsString('did not match any covered classes.', $this->output);
$this->assertStringContainsString('Please consider removing them', $this->output);
}

public function testNotifyWhenNoTrackedLines(): void
Expand Down Expand Up @@ -313,7 +325,9 @@ public function testNotifyWhenNoTrackedLines(): void
0
));

$this->assertMatchesTextSnapshot($this->output);
$this->assertStringContainsString('There was at least one pattern that', $this->output);
$this->assertStringContainsString('did not match any covered classes.', $this->output);
$this->assertStringContainsString('Please consider removing them', $this->output);
}

public function testNotifyWithNonExistingCloverFile(): void
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.