Skip to content

Commit

Permalink
[Privatization] Skip with suffix "TestCase" on FinalizeTestCaseClassR…
Browse files Browse the repository at this point in the history
…ector (#5660)

* [Privatization] Skip with suffix "TestCase" on FinalizeTestCaseClassRector

* Fix
  • Loading branch information
samsonasik committed Feb 23, 2024
1 parent d754bec commit 2d1f468
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
@@ -0,0 +1,17 @@
<?php

namespace Rector\Tests\Privatization\Rector\Class_\FinalizeTestCaseClassRector\Fixture;

use PHPUnit\Framework\TestCase;

class SkipSuffixTestCase extends TestCase
{
protected function setUp(): void
{
parent::setUp();

echo 'init';
}
}

?>
Expand Up @@ -71,6 +71,10 @@ public function refactor(Node $node): ?Node
return null;
}

if (str_ends_with($className, 'TestCase')) {
return null;
}

if (! $this->reflectionProvider->hasClass($className)) {
return null;
}
Expand Down

0 comments on commit 2d1f468

Please sign in to comment.