From d5062e8ebe7148a9e1f9680c78629a67f123b210 Mon Sep 17 00:00:00 2001 From: AslanAV Date: Thu, 11 Jan 2024 17:05:53 +0300 Subject: [PATCH] add tests and lint? and fix lints errors --- .gitea/workflows/php.yml | 0 app/Console/Kernel.php | 2 +- .../Auth/ConfirmablePasswordController.php | 6 +- .../Auth/RegisteredUserController.php | 2 +- .../Auth/VerifyEmailController.php | 4 +- app/Http/Controllers/Controller.php | 3 +- app/Http/Kernel.php | 2 +- app/Http/Requests/Auth/LoginRequest.php | 2 +- app/Http/Requests/ProfileUpdateRequest.php | 3 +- app/Models/User.php | 4 +- composer.json | 6 +- composer.lock | 156 +++++++++++++++++- phpcs.xml | 41 +++++ phpunit.xml | 4 +- routes/web.php | 2 +- tests/CreatesApplication.php | 2 +- tests/Feature/Auth/AuthenticationTest.php | 8 +- tests/Feature/Auth/EmailVerificationTest.php | 8 +- .../Feature/Auth/PasswordConfirmationTest.php | 6 +- tests/Feature/Auth/PasswordResetTest.php | 10 +- tests/Feature/Auth/PasswordUpdateTest.php | 4 +- tests/Feature/Auth/RegistrationTest.php | 4 +- tests/Feature/ExampleTest.php | 2 +- tests/Feature/ProfileTest.php | 10 +- tests/Unit/ExampleTest.php | 2 +- 25 files changed, 243 insertions(+), 50 deletions(-) create mode 100644 .gitea/workflows/php.yml create mode 100644 phpcs.xml diff --git a/.gitea/workflows/php.yml b/.gitea/workflows/php.yml new file mode 100644 index 0000000..e69de29 diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index e6b9960..4c1dd5a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel */ protected function commands(): void { - $this->load(__DIR__.'/Commands'); + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/app/Http/Controllers/Auth/ConfirmablePasswordController.php b/app/Http/Controllers/Auth/ConfirmablePasswordController.php index 523ddda..cbdc7f1 100644 --- a/app/Http/Controllers/Auth/ConfirmablePasswordController.php +++ b/app/Http/Controllers/Auth/ConfirmablePasswordController.php @@ -25,10 +25,12 @@ class ConfirmablePasswordController extends Controller */ public function store(Request $request): RedirectResponse { - if (! Auth::guard('web')->validate([ + if ( + ! Auth::guard('web')->validate([ 'email' => $request->user()->email, 'password' => $request->password, - ])) { + ]) + ) { throw ValidationException::withMessages([ 'password' => __('auth.password'), ]); diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index a15828f..0a60cb3 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -32,7 +32,7 @@ class RegisteredUserController extends Controller { $request->validate([ 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class], + 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:' . User::class], 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]); diff --git a/app/Http/Controllers/Auth/VerifyEmailController.php b/app/Http/Controllers/Auth/VerifyEmailController.php index ea87940..e7257df 100644 --- a/app/Http/Controllers/Auth/VerifyEmailController.php +++ b/app/Http/Controllers/Auth/VerifyEmailController.php @@ -16,13 +16,13 @@ class VerifyEmailController extends Controller public function __invoke(EmailVerificationRequest $request): RedirectResponse { if ($request->user()->hasVerifiedEmail()) { - return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); + return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); } if ($request->user()->markEmailAsVerified()) { event(new Verified($request->user())); } - return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); + return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); } } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 77ec359..f1406be 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -8,5 +8,6 @@ use Illuminate\Routing\Controller as BaseController; class Controller extends BaseController { - use AuthorizesRequests, ValidatesRequests; + use AuthorizesRequests; + use ValidatesRequests; } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 494c050..393b417 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -40,7 +40,7 @@ class Kernel extends HttpKernel 'api' => [ // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, - \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', + \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php index 7a19bc0..cd39451 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/Auth/LoginRequest.php @@ -80,6 +80,6 @@ class LoginRequest extends FormRequest */ public function throttleKey(): string { - return Str::transliterate(Str::lower($this->input('email')).'|'.$this->ip()); + return Str::transliterate(Str::lower($this->input('email')) . '|' . $this->ip()); } } diff --git a/app/Http/Requests/ProfileUpdateRequest.php b/app/Http/Requests/ProfileUpdateRequest.php index 93b0022..c57c088 100644 --- a/app/Http/Requests/ProfileUpdateRequest.php +++ b/app/Http/Requests/ProfileUpdateRequest.php @@ -17,7 +17,8 @@ class ProfileUpdateRequest extends FormRequest { return [ 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)], + 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', + Rule::unique(User::class)->ignore($this->user()->id)], ]; } } diff --git a/app/Models/User.php b/app/Models/User.php index 4d7f70f..7b27eb7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -10,7 +10,9 @@ use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable; + use HasApiTokens; + use HasFactory; + use Notifiable; /** * The attributes that are mass assignable. diff --git a/composer.json b/composer.json index a9ffd4f..7bb3a88 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,9 @@ "nunomaduro/collision": "^7.10.0", "phpunit/phpunit": "^10.5.5", "spatie/laravel-ignition": "^2.4.0", - "barryvdh/laravel-ide-helper": "^2.13.0" + "barryvdh/laravel-ide-helper": "^2.13.0", + "squizlabs/php_codesniffer": "^3.8.0", + "phpstan/phpstan": "^1.10.55" }, "autoload": { "psr-4": { @@ -35,6 +37,8 @@ } }, "scripts": { + "phpcs": "phpcs", + "phpcbf": "phpcbf", "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" diff --git a/composer.lock b/composer.lock index 5120865..62ef1b7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7ab883d941740dee8af1ec0280a43509", + "content-hash": "ee98f0386c39f019aa32fcd8e854a68e", "packages": [ { "name": "brick/math", @@ -7126,16 +7126,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.3", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" + "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", - "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fad452781b3d774e3337b0c0b245dd8e5a4455fc", + "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc", "shasum": "" }, "require": { @@ -7178,9 +7178,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.0" }, - "time": "2023-08-12T11:01:26+00:00" + "time": "2024-01-11T11:49:22+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -7229,6 +7229,68 @@ }, "time": "2024-01-04T17:06:16+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.10.55", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "9a88f9d18ddf4cf54c922fbeac16c4cb164c5949" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9a88f9d18ddf4cf54c922fbeac16c4cb164c5949", + "reference": "9a88f9d18ddf4cf54c922fbeac16c4cb164c5949", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2024-01-08T12:32:40+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "10.1.11", @@ -8922,6 +8984,86 @@ ], "time": "2024-01-04T14:51:24+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T12:32:31+00:00" + }, { "name": "symfony/yaml", "version": "v6.4.0", diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..d84ae86 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,41 @@ + + + + PSR12 Laravel standards. + + + + + + + + + + app + config + resources + routes + tests + database + + + + + + + app/Console/Kernel.php + app/Http/Controllers/Controller.php + app/Http/Controllers/Auth/* + app/Http/Requests/Auth/LoginRequest.php + bootstrap/cache/* + config/* + public/index.php + storage/framework/views/* + server.php + */migrations/* + */seeds/* + */*.blade.php + */*.js + vendor/* + node_modules/* + diff --git a/phpunit.xml b/phpunit.xml index bc86714..ed8872f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -21,8 +21,8 @@ - - + + diff --git a/routes/web.php b/routes/web.php index bc70600..b15cfad 100644 --- a/routes/web.php +++ b/routes/web.php @@ -40,4 +40,4 @@ Route::middleware('auth')->group(function () { Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); }); -require __DIR__.'/auth.php'; +require __DIR__ . '/auth.php'; diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index cc68301..e3ad27e 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -12,7 +12,7 @@ trait CreatesApplication */ public function createApplication(): Application { - $app = require __DIR__.'/../bootstrap/app.php'; + $app = require __DIR__ . '/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); diff --git a/tests/Feature/Auth/AuthenticationTest.php b/tests/Feature/Auth/AuthenticationTest.php index 0303b29..9e1778a 100644 --- a/tests/Feature/Auth/AuthenticationTest.php +++ b/tests/Feature/Auth/AuthenticationTest.php @@ -11,14 +11,14 @@ class AuthenticationTest extends TestCase { use RefreshDatabase; - public function test_login_screen_can_be_rendered(): void + public function testLoginScreenCanBeRendered(): void { $response = $this->get('/login'); $response->assertStatus(200); } - public function test_users_can_authenticate_using_the_login_screen(): void + public function testUsersCanAuthenticateUsingTheLoginScreen(): void { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class AuthenticationTest extends TestCase $response->assertRedirect(RouteServiceProvider::HOME); } - public function test_users_can_not_authenticate_with_invalid_password(): void + public function testUsersCanNotAuthenticateWithInvalidPassword(): void { $user = User::factory()->create(); @@ -43,7 +43,7 @@ class AuthenticationTest extends TestCase $this->assertGuest(); } - public function test_users_can_logout(): void + public function testUsersCanLogout(): void { $user = User::factory()->create(); diff --git a/tests/Feature/Auth/EmailVerificationTest.php b/tests/Feature/Auth/EmailVerificationTest.php index ba19d9c..7ce5493 100644 --- a/tests/Feature/Auth/EmailVerificationTest.php +++ b/tests/Feature/Auth/EmailVerificationTest.php @@ -14,7 +14,7 @@ class EmailVerificationTest extends TestCase { use RefreshDatabase; - public function test_email_verification_screen_can_be_rendered(): void + public function testEmailVerificationScreenCanBeRendered(): void { $user = User::factory()->create([ 'email_verified_at' => null, @@ -25,7 +25,7 @@ class EmailVerificationTest extends TestCase $response->assertStatus(200); } - public function test_email_can_be_verified(): void + public function testEmailCanBeVerified(): void { $user = User::factory()->create([ 'email_verified_at' => null, @@ -43,10 +43,10 @@ class EmailVerificationTest extends TestCase Event::assertDispatched(Verified::class); $this->assertTrue($user->fresh()->hasVerifiedEmail()); - $response->assertRedirect(RouteServiceProvider::HOME.'?verified=1'); + $response->assertRedirect(RouteServiceProvider::HOME . '?verified=1'); } - public function test_email_is_not_verified_with_invalid_hash(): void + public function testEmailIsNotVerifiedWithInvalidHash(): void { $user = User::factory()->create([ 'email_verified_at' => null, diff --git a/tests/Feature/Auth/PasswordConfirmationTest.php b/tests/Feature/Auth/PasswordConfirmationTest.php index ff85721..322c2cc 100644 --- a/tests/Feature/Auth/PasswordConfirmationTest.php +++ b/tests/Feature/Auth/PasswordConfirmationTest.php @@ -10,7 +10,7 @@ class PasswordConfirmationTest extends TestCase { use RefreshDatabase; - public function test_confirm_password_screen_can_be_rendered(): void + public function testConfirmPasswordScreenCanBeRendered(): void { $user = User::factory()->create(); @@ -19,7 +19,7 @@ class PasswordConfirmationTest extends TestCase $response->assertStatus(200); } - public function test_password_can_be_confirmed(): void + public function testPasswordCanBeConfirmed(): void { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class PasswordConfirmationTest extends TestCase $response->assertSessionHasNoErrors(); } - public function test_password_is_not_confirmed_with_invalid_password(): void + public function testPasswordIsNotConfirmedWithInvalidPassword(): void { $user = User::factory()->create(); diff --git a/tests/Feature/Auth/PasswordResetTest.php b/tests/Feature/Auth/PasswordResetTest.php index 4a26065..2fdfea4 100644 --- a/tests/Feature/Auth/PasswordResetTest.php +++ b/tests/Feature/Auth/PasswordResetTest.php @@ -12,14 +12,14 @@ class PasswordResetTest extends TestCase { use RefreshDatabase; - public function test_reset_password_link_screen_can_be_rendered(): void + public function testResetPasswordLinkScreenCanBeRendered(): void { $response = $this->get('/forgot-password'); $response->assertStatus(200); } - public function test_reset_password_link_can_be_requested(): void + public function testResetPasswordLinkCanBeRequested(): void { Notification::fake(); @@ -30,7 +30,7 @@ class PasswordResetTest extends TestCase Notification::assertSentTo($user, ResetPassword::class); } - public function test_reset_password_screen_can_be_rendered(): void + public function testResetPasswordScreenCanBeRendered(): void { Notification::fake(); @@ -39,7 +39,7 @@ class PasswordResetTest extends TestCase $this->post('/forgot-password', ['email' => $user->email]); Notification::assertSentTo($user, ResetPassword::class, function ($notification) { - $response = $this->get('/reset-password/'.$notification->token); + $response = $this->get('/reset-password/' . $notification->token); $response->assertStatus(200); @@ -47,7 +47,7 @@ class PasswordResetTest extends TestCase }); } - public function test_password_can_be_reset_with_valid_token(): void + public function testPasswordCanbeResetWithValidToken(): void { Notification::fake(); diff --git a/tests/Feature/Auth/PasswordUpdateTest.php b/tests/Feature/Auth/PasswordUpdateTest.php index ca28c6c..b22369c 100644 --- a/tests/Feature/Auth/PasswordUpdateTest.php +++ b/tests/Feature/Auth/PasswordUpdateTest.php @@ -11,7 +11,7 @@ class PasswordUpdateTest extends TestCase { use RefreshDatabase; - public function test_password_can_be_updated(): void + public function testPasswordCanBeUpdated(): void { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class PasswordUpdateTest extends TestCase $this->assertTrue(Hash::check('new-password', $user->refresh()->password)); } - public function test_correct_password_must_be_provided_to_update_password(): void + public function testCorrectPasswordMustBeProvidedToUpdatePassword(): void { $user = User::factory()->create(); diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index 30829b1..7dfec00 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -10,14 +10,14 @@ class RegistrationTest extends TestCase { use RefreshDatabase; - public function test_registration_screen_can_be_rendered(): void + public function testRegistrationScreenCanBeRendered(): void { $response = $this->get('/register'); $response->assertStatus(200); } - public function test_new_users_can_register(): void + public function testNewUsersCanRegister(): void { $response = $this->post('/register', [ 'name' => 'Test User', diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 8364a84..b8ab24a 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -10,7 +10,7 @@ class ExampleTest extends TestCase /** * A basic test example. */ - public function test_the_application_returns_a_successful_response(): void + public function testTheApplicationReturnsASuccessfulResponse(): void { $response = $this->get('/'); diff --git a/tests/Feature/ProfileTest.php b/tests/Feature/ProfileTest.php index 252fdcc..950f745 100644 --- a/tests/Feature/ProfileTest.php +++ b/tests/Feature/ProfileTest.php @@ -10,7 +10,7 @@ class ProfileTest extends TestCase { use RefreshDatabase; - public function test_profile_page_is_displayed(): void + public function testProfilePageIsDisplayed(): void { $user = User::factory()->create(); @@ -21,7 +21,7 @@ class ProfileTest extends TestCase $response->assertOk(); } - public function test_profile_information_can_be_updated(): void + public function testProfileInformationCanBeUpdated(): void { $user = User::factory()->create(); @@ -43,7 +43,7 @@ class ProfileTest extends TestCase $this->assertNull($user->email_verified_at); } - public function test_email_verification_status_is_unchanged_when_the_email_address_is_unchanged(): void + public function testEmailVerificationStatusIsUnchangedWhenTheEmailAddressAsUnchanged(): void { $user = User::factory()->create(); @@ -61,7 +61,7 @@ class ProfileTest extends TestCase $this->assertNotNull($user->refresh()->email_verified_at); } - public function test_user_can_delete_their_account(): void + public function testUserCanDeleteTheirAccount(): void { $user = User::factory()->create(); @@ -79,7 +79,7 @@ class ProfileTest extends TestCase $this->assertNull($user->fresh()); } - public function test_correct_password_must_be_provided_to_delete_account(): void + public function testCorrectPasswordMustBeProvidedToDeleteAccount(): void { $user = User::factory()->create(); diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 5773b0c..b5da561 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -9,7 +9,7 @@ class ExampleTest extends TestCase /** * A basic test example. */ - public function test_that_true_is_true(): void + public function testThatTrueIsTrue(): void { $this->assertTrue(true); }