pestphp / drift

[WIP] Command-line tool to migrate your PHPUnit tests to Pest
https://pestphp.com/docs/guides/drift
MIT License
28 stars 7 forks source link

[Rector] Renaming #8

Closed olivernybroe closed 4 years ago

olivernybroe commented 4 years ago

Create a new rector for renaming the test.

For example when migrating a phpunit test it will take the method name directly and not touch the name. This rectors responsible should be to rename the test to have a more pest like naming.

owenvoke commented 4 years ago

I'd love to look into this. How were you thinking of the names being? 🤔 I guess splitting it into a lowercase space-separated string?

Using it() if the test name starts with it/testIt, and test() for others?

olivernybroe commented 4 years ago

@owenvoke I think that makes sense 😄

I haven't thought too much about this rector. My first thoughts were just something as simple as removing test from the name and splitting the string.

I think your idea is great.

My thought was that this rector (together with other rectors) are something you run for making your pest tests prettier, so something that should be used for the polish command 👍

We will of course also run this with the migrate command, but it will run after the migrations from phpunit has happened.