kubawerlos/php-cs-fixer-custom-fixers

Option to strip underscore prefix with DataProviderNameFixer

Closed this issue · 2 comments

Is it possible to exclude the underscore when the prefix is empty?

Config:

['prefix' => '', 'suffix' => '_data_provider']

Outcome:

<?php
 class FooTest extends TestCase {
     /**
-     * @dataProvider dataProvider
+     * @dataProvider happy_path_data_provider
      */
     public function test_happy_path() {}
-    public function dataProvider() {}
+    public function _happy_path_data_provider() {}
 }

Expected:

<?php
 class FooTest extends TestCase {
     /**
-     * @dataProvider dataProvider
+     * @dataProvider happy_path_data_provider
      */
     public function test_happy_path() {}
-    public function dataProvider() {}
+    public function happy_path_data_provider() {}
 }

@weshooper it was released with 2.3.0.

@kubawerlos thank you so much! That looks like a nice release :-)