Skip to content

Commit

Permalink
Add failing test fixture for RenameMethodRector
Browse files Browse the repository at this point in the history
# Failing Test for RenameMethodRector

Based on https://getrector.org/demo/38775b0b-7f57-4f18-97ac-b39a71fa6d78

It should detect that the old method is not public and that the new magic method `__invoke` can only be applied when public.

# The commit message rectorphp#2 will be skipped:

# xx
  • Loading branch information
ruudk committed Feb 14, 2021
1 parent 70168f4 commit fc8937d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture;

final class SkipPrivateMethodRenameToPrivateInvoke
final class SkipRenamePrivateMethodToPrivateInvoke
{
private function notify()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Nette\Utils\Html;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\SkipPrivateMethodRenameToPrivateInvoke;
use Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\SkipRenamePrivateMethodToPrivateInvoke;
use Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Source\AbstractType;
use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Renaming\ValueObject\MethodCallRenameWithArrayKey;
Expand All @@ -20,11 +21,7 @@
'notify',
'__invoke'
),
new MethodCallRename(
'Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\SkipPrivateMethodRenameToPrivateInvoke',
'notify',
'__invoke'
),
new MethodCallRename(SkipRenamePrivateMethodToPrivateInvoke::class, 'notify', '__invoke'),
new MethodCallRename('*Presenter', 'run', '__invoke'),
new MethodCallRename(
\Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\SkipSelfMethodRename::class,
Expand Down

0 comments on commit fc8937d

Please sign in to comment.