From 6c0e74c89e2087ee96c94e1cb4c4e9b34df363a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Mon, 2 Feb 2026 15:58:26 +0100 Subject: [PATCH] =?UTF-8?q?Newer=20Rector=20versions=20don=E2=80=99t=20hav?= =?UTF-8?q?e=20AddCoversClassAttributeRector=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rectorphp/rector-phpunit/pull/561/ --- tests/methods/UnparseTest.php | 3 +++ tests/rector.php | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/methods/UnparseTest.php b/tests/methods/UnparseTest.php index 60448dd..53bf0cc 100644 --- a/tests/methods/UnparseTest.php +++ b/tests/methods/UnparseTest.php @@ -43,6 +43,9 @@ class UnparseTest extends Testcase { $this->unparseAndCompare($expected); } + /** + * @doesNotPerformAssertions + */ public function testUnparseDefaultWithoutHeading() { $this->csv->heading = false; $this->csv->auto(__DIR__ . '/fixtures/auto-double-enclosure.csv'); diff --git a/tests/rector.php b/tests/rector.php index 5878741..a896027 100644 --- a/tests/rector.php +++ b/tests/rector.php @@ -3,14 +3,15 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\PHPUnit\CodeQuality\Rector\Class_\AddCoversClassAttributeRector; use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector; -use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector; use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector; -use \Rector\Php80\Rector\Class_\AnnotationToAttributeRector; +use Rector\PHPUnit\CodeQuality\Rector\Class_\AddCoversClassAttributeRector; +use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector; return static function(RectorConfig $rectorConfig): void { - $rectorConfig->rule(AddCoversClassAttributeRector::class); + if (class_exists(AddCoversClassAttributeRector::class)) { + $rectorConfig->rule(AddCoversClassAttributeRector::class); + } $rectorConfig->rule(DataProviderAnnotationToAttributeRector::class); $rectorConfig->rule(AddDoesNotPerformAssertionToNonAssertingTestRector::class); $rectorConfig->rule(DependsAnnotationWithValueToAttributeRector::class);