RegistrationTest.php 551 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Tests\Feature\Auth;
  3. use Illuminate\Foundation\Testing\RefreshDatabase;
  4. use Tests\TestCase;
  5. class RegistrationTest extends TestCase
  6. {
  7. use RefreshDatabase;
  8. public function test_new_users_can_register(): void
  9. {
  10. $response = $this->post('/register', [
  11. 'name' => 'Test User',
  12. 'email' => 'test@example.com',
  13. 'password' => 'password',
  14. 'password_confirmation' => 'password',
  15. ]);
  16. $this->assertAuthenticated();
  17. $response->assertNoContent();
  18. }
  19. }