From b844b60d05ce879491ee4881579233752e267f46 Mon Sep 17 00:00:00 2001 From: Johnny Walker Date: Fri, 19 May 2023 12:14:30 +0100 Subject: [PATCH 1/2] Change test case methods to snake_case Update naming convention to match official Laravel documentation. These best practices are currently out-of-step with modern Laravel standards. * Laravel [officially changed to snake_case](https://github.com/laravel/laravel/pull/5574) for test case methods in version 8.0. * [Official Laravel documentation](https://laravel.com/docs/10.x/testing) uses snake_case. * [Laracast videos](https://laracasts.com/series/phpunit-testing-in-laravel/episodes/2) use snake_case. * The [previous discussion's](#28) conclusions on this matter are no longer correct. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c178b0e..2c15680 100644 --- a/README.md +++ b/README.md @@ -520,7 +520,7 @@ Primary key | - | id | ~~custom_id~~ Migration | - | 2017_01_01_000000_create_articles_table | ~~2017_01_01_000000_articles~~ Method | camelCase | getAll | ~~get_all~~ Method in resource controller | [table](https://laravel.com/docs/master/controllers#resource-controllers) | store | ~~saveArticle~~ -Method in test class | camelCase | testGuestCannotSeeArticle | ~~test_guest_cannot_see_article~~ +Method in test class | snake_case | test_guest_cannot_see_article | ~~testGuestCannotSeeArticle~~ Variable | camelCase | $articlesWithAuthor | ~~$articles_with_author~~ Collection | descriptive, plural | $activeUsers = User::active()->get() | ~~$active, $data~~ Object | descriptive, singular | $activeUser = User::active()->first() | ~~$users, $obj~~ From 2cc41fc22059d501fac4cddc44a2ad19eb6a582f Mon Sep 17 00:00:00 2001 From: Johnny Walker Date: Wed, 11 Sep 2024 11:55:43 +0100 Subject: [PATCH 2/2] Update README.md Updated to show the official support for Pest --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c15680..dddcb4a 100644 --- a/README.md +++ b/README.md @@ -479,7 +479,7 @@ Authorization | Policies | Entrust, Sentinel and other packages Compiling assets | Laravel Mix, Vite | Grunt, Gulp, 3rd party packages Development Environment | Laravel Sail, Homestead | Docker Deployment | Laravel Forge | Deployer and other solutions -Unit testing | PHPUnit, Mockery | Phpspec, Pest +Unit testing | PHPUnit, Pest, Mockery | Phpspec Browser testing | Laravel Dusk | Codeception DB | Eloquent | SQL, Doctrine Templates | Blade | Twig @@ -520,7 +520,7 @@ Primary key | - | id | ~~custom_id~~ Migration | - | 2017_01_01_000000_create_articles_table | ~~2017_01_01_000000_articles~~ Method | camelCase | getAll | ~~get_all~~ Method in resource controller | [table](https://laravel.com/docs/master/controllers#resource-controllers) | store | ~~saveArticle~~ -Method in test class | snake_case | test_guest_cannot_see_article | ~~testGuestCannotSeeArticle~~ +Method in PHPUnit test class | snake_case | test_guest_cannot_see_article | ~~testGuestCannotSeeArticle~~ Variable | camelCase | $articlesWithAuthor | ~~$articles_with_author~~ Collection | descriptive, plural | $activeUsers = User::active()->get() | ~~$active, $data~~ Object | descriptive, singular | $activeUser = User::active()->first() | ~~$users, $obj~~