Skip to content

Commit d1d80a9

Browse files
authored
build(phpunit): Bump PHPUnit to v11 (#36)
- Upgrades `phpunit/phpunit` from `^9.6.29` to `^11.5.41`. - Adjusts `CovCatcher::start` to match the updated `php-code-coverage` API, now requiring `null` for the second argument. - Adds a check in `CovCatcher::getCoverageFilter` to prevent attempting to include files from an empty directory path.
1 parent d8b2c0f commit d1d80a9

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"ext-filter" : "*",
3131
"ext-mbstring" : "*",
3232

33-
"phpunit/phpunit" : "^9.6.29",
33+
"phpunit/phpunit" : "^11.5.41",
3434
"ulrichsg/getopt-php" : ">=4.0.4",
3535
"jbzoo/markdown" : "^7.0.1"
3636
},

src/CovCatcher.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private function start(): void
122122
{
123123
if (!$this->isStarted) {
124124
$this->isStarted = true;
125-
$this->coverage?->start($this->hash, true);
125+
$this->coverage?->start($this->hash, null, true);
126126
}
127127
}
128128

@@ -188,8 +188,10 @@ private static function prepareFilter(string $dirPath): Filter
188188
{
189189
$covFilter = new Filter();
190190

191-
foreach ((new FileIteratorFacade())->getFilesAsArray($dirPath, '.php') as $file) {
192-
$covFilter->includeFile($file);
191+
if ($dirPath !== '') {
192+
foreach ((new FileIteratorFacade())->getFilesAsArray($dirPath, '.php') as $file) {
193+
$covFilter->includeFile($file);
194+
}
193195
}
194196

195197
return $covFilter;

0 commit comments

Comments
 (0)