Rector: We need your help with testing Rector 0.9

Created on 17 Dec 2020  路  8Comments  路  Source: rectorphp/rector

We're working hard last month on next release of Rector - 0.9.
First we waited for PHP 8.0, Symfony 5.2 and Symplify 9 to be released. We tested many PHP 8 rules for edge cases, so we could fix those and give you the final version.

How to Test Rector 0.9?

We want to let it out this week and we need your help with testing:

 {
     "require-dev": {
-        "rector/rector": "^0.8"
+        "rector/rector": "dev-master"
     }
 }

The more feedback we have on Rector 0.9, the sooner we can release it.


How to Upgrade?

Know changes between 0.8 and 0.9 are mentioned here: https://github.com/rectorphp/rector/blob/master/UPGRADE_09.md

Is something missing? Please create and issues, or if you want to help up, change the file and send us a PR.

All 8 comments

On dev-master I'm still facing

 [ERROR] Could not process "app/Models/Type.php" file, due to:                                                          
         "_HumbugBox39a196d4601e\Roave\BetterReflection\Reflection\ReflectionClass "Carbon\Traits\Localization" could   
         not be found in the located source". 

Which is already logged here: https://github.com/rectorphp/rector/issues/4406

I am indeed testing on a Laravel project. Will report more as I go through testing all the rule sets.

I have problems with apps where symfony 4.2 packages (especially symfony/config I think) are used as dependencies so I am waiting for prefixed version to test it

Great work!

I'll take a closer look later on, but here are some things I've found so far:

Rector\SOLID\Rector\Variable\MoveVariableDeclarationNearReferenceRector has some 'false positives' in my test suite when using static methods:

$crawler = $kernelBrowser->request('GET', '/');
self::assertResponseIsSuccessful();
self::assertStringContainsString('Hello World', $crawler->filter('h1, h2, h3')->text());

Rector wants to move the first line to the second, but that breaks self::assertResponseIsSuccessful();. These static methods reminds me of the time I was using Wordpress, with all those terrible superglobals. But well, that's how phpunit works here.

And I get an Segmentation fault (core dumped) message, but no idea how to debug this.

Thanks @samsonasik!

The only problem I have is a Segmentation fault on one method. I'll try to create a reproducible example.

On dev-master I'm still facing

 [ERROR] Could not process "app/Models/Type.php" file, due to:                                                          
         "_HumbugBox39a196d4601e\Roave\BetterReflection\Reflection\ReflectionClass "Carbon\Traits\Localization" could   
         not be found in the located source". 

Which is already logged here: #4406

I am indeed testing on a Laravel project. Will report more as I go through testing all the rule sets.

This appears to be fixed on Rector dev-master@8a64821

@stephanvierkant Hi, thank you for looking into this.
Next step would be getting a failing demo link: https://getrector.org/demo

@lulco @HDVinnie

Good news! :partying_face: The prefixed version is now passing on simple tests:

image


Could you give it more propper :muscle: battle testing?
https://github.com/rectorphp/rector-prefixed

It's out now! :clap: Thank you for testing and feedback :heart:

image

https://getrector.org/blog/2020/12/28/rector-09-released



(For any further issues, please make a new ones.)

Was this page helpful?
0 / 5 - 0 ratings