AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

RegistrationTest.php 919B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Tests\Feature\Auth;
  3. use Illuminate\Foundation\Testing\RefreshDatabase;
  4. use Laravel\Fortify\Features;
  5. use Tests\TestCase;
  6. class RegistrationTest extends TestCase
  7. {
  8. use RefreshDatabase;
  9. protected function setUp(): void
  10. {
  11. parent::setUp();
  12. $this->skipUnlessFortifyHas(Features::registration());
  13. }
  14. public function test_registration_screen_can_be_rendered()
  15. {
  16. $response = $this->get(route('register'));
  17. $response->assertOk();
  18. }
  19. public function test_new_users_can_register()
  20. {
  21. $response = $this->post(route('register.store'), [
  22. 'name' => 'Test User',
  23. 'email' => 'test@example.com',
  24. 'password' => 'password',
  25. 'password_confirmation' => 'password',
  26. ]);
  27. $this->assertAuthenticated();
  28. $response->assertRedirect(route('dashboard', absolute: false));
  29. }
  30. }