Skip to content

Commit 6c0e74c

Browse files
committed
Newer Rector versions don’t have AddCoversClassAttributeRector anymore
rectorphp/rector-phpunit#561
1 parent c47ba79 commit 6c0e74c

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

tests/methods/UnparseTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public function testUnparseDefault() {
4343
$this->unparseAndCompare($expected);
4444
}
4545

46+
/**
47+
* @doesNotPerformAssertions
48+
*/
4649
public function testUnparseDefaultWithoutHeading() {
4750
$this->csv->heading = false;
4851
$this->csv->auto(__DIR__ . '/fixtures/auto-double-enclosure.csv');

tests/rector.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddCoversClassAttributeRector;
76
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector;
8-
use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector;
97
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector;
10-
use \Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
8+
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddCoversClassAttributeRector;
9+
use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector;
1110

1211
return static function(RectorConfig $rectorConfig): void {
13-
$rectorConfig->rule(AddCoversClassAttributeRector::class);
12+
if (class_exists(AddCoversClassAttributeRector::class)) {
13+
$rectorConfig->rule(AddCoversClassAttributeRector::class);
14+
}
1415
$rectorConfig->rule(DataProviderAnnotationToAttributeRector::class);
1516
$rectorConfig->rule(AddDoesNotPerformAssertionToNonAssertingTestRector::class);
1617
$rectorConfig->rule(DependsAnnotationWithValueToAttributeRector::class);

0 commit comments

Comments
 (0)