Skip to content

Commit 153d966

Browse files
authored
Don't add DisableReturnValueGenerationForTestDoubles to abstract classes via Rector (#78)
1 parent d9ee520 commit 153d966

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Rector/EnforceDisableReturnValueGenerationForTestDoublesRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public function refactor(Node $node): ?Class_
6262
return null;
6363
}
6464

65+
if ($node->isAbstract()) {
66+
return null;
67+
}
68+
6569
if ($this->attributeAnalyzer->hasPhpAttribute($node, DisableReturnValueGenerationForTestDoubles::class)) {
6670
return null;
6771
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace Tests\Rector\Lendable\PHPUnitExtensions\Rector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
abstract class AbstractWithoutAttributeTest extends TestCase
8+
{
9+
}

0 commit comments

Comments
 (0)