Created
October 26, 2023 19:07
-
-
Save Tynael/d081b6d93f9fb1fe42d3c1fdf088405e to your computer and use it in GitHub Desktop.
Laravel — Improve Email Validation
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
<?php | |
declare(strict_types=1); | |
namespace Tests\Feature; | |
use Tests\TestCase; | |
use Faker\Factory as Faker; | |
class UserControllerTest extends TestCase | |
{ | |
public function test_can_create_user(): void | |
{ | |
$faker = Faker::create(); | |
$response = $this->postJson( | |
route('user.create'), | |
[ | |
'name' => $faker->name, | |
'password' => $faker->password(), | |
'email' => '[email protected]', | |
]); | |
$response->assertSuccessful(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example used in https://neutrondev.com/laravel-improve-email-validation/