rector: [PHPUnit] Can not get PHPUnit assert methods refactored

@TomasVotruba As suggested to you, I’m opening this issue to track this. I’ll use Phalcon Framework as an example. Steps to reproduce:

1º: Fork

I forked and checkout the 4.0.x branch.

2º Run Rector

I installed Rector globally, with #207, and I ran:

rector process tests/ --level phpunit60

Only the tests/_ci/phpunit.php file got changed:

- PHPUnit_TextUI_Command::main();
+ PHPUnit\TextUI\Command::main();

There are many file_exists, is_* (not merged wet here #199), that didn’t got affected. I tried to reproduce a PR I did a while ago there #13192.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Closing as there are so many various issues far from the original one. The install one is covered in #258

One more bug discovered:

In ProcessCommand.php line 172:
[Rector\Exception\Command\FileProcessingException]
Processing of "tests//Database/DatabaseEloquentBuilderTest.php" file failed.

In AssertCompareToSpecificMethodRector.php line 89:
[Error]
Call to undefined method PhpParser\Node\Expr\ArrayDimFetch::toString()

@TomasVotruba I’ll try to fix it.

The PR on laravel/framework was merged. I’m going to rebase my fork and try again. I update if anything crashes.

@TomasVotruba I opened a PR in laravel/framework to fix it. Was a missed typo.

- * @return \Illuminate\Contracts\Session\Session.
+ * @return \Illuminate\Contracts\Session\Session

Until the exception get resolved, it probably won’t work.

If you get different exception, please create new issue to make it clear

So it isn’t working because of subfolder, but because of this Exception Error? 😅

After short Christmass break I’m back 👍 I’ll try to simulate your scenario and try it out

I recall I had many troubles with compser global at @apigen, let’s narrow allowed installitions to composer create-project * and composer require to not waste time with that.

Could you retry with that?