diff --git a/Makefile b/Makefile index 850356e8..64e907b4 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ all: csfix static-analysis code-coverage vendor: composer.json composer update + composer bump touch vendor .PHONY: csfix diff --git a/composer.json b/composer.json index b1cfa937..5d4c716d 100644 --- a/composer.json +++ b/composer.json @@ -39,23 +39,22 @@ "ext-reflection": "*", "ext-simplexml": "*", "jean85/pretty-package-versions": "^2.0.5", - "phpunit/php-code-coverage": "^9.2.17", + "phpunit/php-code-coverage": "^9.2.19", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.5.24", + "phpunit/phpunit": "^9.5.26", "sebastian/environment": "^5.1.4", - "symfony/console": "^5.4.12 || ^6.1.4", - "symfony/process": "^5.4.11 || ^6.1.3" + "symfony/console": "^5.4.12 || ^6.2", + "symfony/process": "^5.4.11 || ^6.2" }, "require-dev": { "ext-pcov": "*", "ext-posix": "*", "doctrine/coding-standard": "^10.0.0", - "infection/infection": "^0.26.14", - "malukenho/mcbumpface": "^1.1.5", + "infection/infection": "^0.26.16", "squizlabs/php_codesniffer": "^3.7.1", - "symfony/filesystem": "^5.4.12 || ^6.1.4", - "vimeo/psalm": "^4.27.0" + "symfony/filesystem": "^5.4.12 || ^6.2", + "vimeo/psalm": "^5.1" }, "autoload": { "psr-4": { @@ -78,8 +77,7 @@ "allow-plugins": { "composer/package-versions-deprecated": true, "dealerdirect/phpcodesniffer-composer-installer": true, - "infection/extension-installer": true, - "malukenho/mcbumpface": true + "infection/extension-installer": true }, "sort-packages": true } diff --git a/src/Logging/JUnit/TestCase.php b/src/Logging/JUnit/TestCase.php index 5b6d8bc9..f55b642d 100644 --- a/src/Logging/JUnit/TestCase.php +++ b/src/Logging/JUnit/TestCase.php @@ -70,7 +70,7 @@ final public static function caseFromNode(SimpleXMLElement $node): self { $systemOutput = null; $systemOutputs = $node->xpath('system-out'); - if ($systemOutputs !== []) { + if ($systemOutputs !== null && $systemOutputs !== []) { assert(count($systemOutputs) === 1); $systemOutput = (string) current($systemOutputs); } @@ -83,13 +83,15 @@ final public static function caseFromNode(SimpleXMLElement $node): self return $node; }; $getType = static function (SimpleXMLElement $node): string { - $attributes = iterator_to_array($node->attributes()); + $element = $node->attributes(); + assert($element !== null); + $attributes = iterator_to_array($element); assert($attributes !== []); return (string) $attributes['type']; }; - if (($errors = $node->xpath('error')) !== []) { + if (($errors = $node->xpath('error')) !== null && $errors !== []) { $error = $getFirstNode($errors); $type = $getType($error); $text = (string) $error; @@ -124,7 +126,7 @@ class_exists($type) ); } - if (($warnings = $node->xpath('warning')) !== []) { + if (($warnings = $node->xpath('warning')) !== null && $warnings !== []) { $warning = $getFirstNode($warnings); $type = $getType($warning); $text = (string) $warning; @@ -142,7 +144,7 @@ class_exists($type) ); } - if (($failures = $node->xpath('failure')) !== []) { + if (($failures = $node->xpath('failure')) !== null && $failures !== []) { $failure = $getFirstNode($failures); $type = $getType($failure); $text = (string) $failure; diff --git a/test/Unit/Coverage/CoverageReporterTest.php b/test/Unit/Coverage/CoverageReporterTest.php index c07ce4da..3c393d60 100644 --- a/test/Unit/Coverage/CoverageReporterTest.php +++ b/test/Unit/Coverage/CoverageReporterTest.php @@ -38,7 +38,7 @@ private function createCoverageReporter(string $fixtureFile): void $filter->includeFile(__FILE__); $codeCoverage = new CodeCoverage((new Selector())->forLineCoverage($filter), $filter); $codeCoverage->append(RawCodeCoverageData::fromXdebugWithoutPathCoverage([ - __FILE__ => [__LINE__ => 1], + __FILE__ => [__LINE__ - 1 => 1], ]), uniqid('test_')); $configuration = (new Loader())->load($this->fixture($fixtureFile));