Back

PHPStorm String Manipulation plugin makes refactoring easy.

Convert PHPUnit test from: testUserCanCreateAccount() → test_user_can_create_account()

#php #phpunit

1

177

In response to @maartenpaauw

I also use php-cs-fixer or Rector for this (but to go the other way, from snake to camel). You can even restrict rules to particular folders if you want your `tests` directory to use a different style than `app`.

1

55

  • No matching results...
  • Searching...

/ 1000

Poll Options

Sounds like a great style fixer! Are those rules shipped with php-cs-fixer / rector? Or is it a custom rule?

1

139

It's a built in rule for php-cs-fixer: cs.symfony.com/doc/rules/php_unit/php_unit_method_casing.html

Here's the config we use: github.com/NoCompromises/php-cs-fixer-config



It's based primarily on the PhpCsFixer default rule set (which includes that rule) and some small tweaks we like.

81