Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

snmd73's avatar

Testing Spark Registration Route

I literally never have any luck here, but here goes...

I'm trying to test Spark Registration, but it's not working. I have:

    public function testUserRegistration(array $overrideFields = []): TestResponse {
        $response = $this->post('/register', array_merge($this->userRegistrationData(), $overrideFields));
        $response->assertStatus(200);
    }

The error I'm getting is "The payment method you provided has already been attached to a user". The thing is, the payment method changes with each registration. I tried passing a random one and of course it doesn't work.

In this extremely outdated test, he seems to be calling $this->getStripeToken() and has a Class of InteractsWithPaymentProviders, but these seem to be deprecated as I can't access them.

Does anyone have any clue how to test these routes?

0 likes
0 replies

Please or to participate in this conversation.