create(); $response = $this->post('api/v1/account/authentication/login/check_email', [ 'email' => $user->email ]); $response->assertStatus(200) ->assertSee("User found Successful") ->assertSee("Account Already Exists"); } public function test_check_unknown_email() { $response = $this->post('api/v1/account/authentication/login/check_email', [ 'email' => 'random_email@test.com' ]); $response->assertStatus(404) ->assertSee("User found failed") ->assertSee("Unable to find any record based on the criteria provided"); } //todo test post success email verification public function test_email_verification() { $user = User::factory()->create(); //todo create a new email verification token, not post request method found $response = $this->actingAs($user)->post('api/v1/account/email/verify', [ 'token' => 'simple_string' ]); //todo need to register notification services on IOC $response->assertStatus(404); } public function test_resend_email() { $user = User::factory()->create(); //create a new email verification token, not post request method found $response = $this->actingAs($user)->post('api/v1/account/email/verification/resend', [ 'user_id' => $user->id ]); $response->assertStatus(200) ->assertSee("Resend Verification Email Successful") ->assertSee("Successfully resent a new verification email"); } public function test_change_email() { $user = User::factory()->create(); $token = JWTAuth::fromUser($user); //create a new email verification token, not post request method found $response = $this->withHeaders([ 'Authorization' => 'Bearer ' . $token, ])->json('POST', 'api/v1/company/team/create', [ 'email' => "newemail@test.abc" ]); //todo add user payload to the response and assert json $response->assertStatus(200) ->assertSee("Updated Email Successful") ->assertSee("Successfully updated email"); } }