-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] Enforce
snake_case
methods for PHPUnit method in Laravel pres…
…et (#300) * Use snake_case for PHPUnit method names * Sort
- Loading branch information
1 parent
57383e8
commit 0f732e0
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
use function Illuminate\Filesystem\join_paths; | ||
|
||
it('fixes the code', function () { | ||
[$statusCode, $output] = run('default', [ | ||
'path' => base_path('tests/Fixtures/fixers/phpunit_method_casing.php'), | ||
'--preset' => 'laravel', | ||
]); | ||
|
||
expect($statusCode)->toBe(1) | ||
->and($output) | ||
->toContain(' ⨯ '.join_paths('tests', 'Fixtures', 'fixers', 'phpunit_method_casing.php')) | ||
->toContain(<<<'DIFF' | ||
- public function testItConvertsToSnakeCase() | ||
+ public function test_it_converts_to_snake_case() | ||
DIFF); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Tests\TestCase; | ||
|
||
class PhpUnitCasingTest extends TestCase | ||
{ | ||
public function testItConvertsToSnakeCase() | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |