create($this->user); Sanctum::actingAs($user); $this->postJson('/api/user/subscription/upgrade', [ 'billing' => $this->billing, 'plan' => $this->plan, 'payment' => [ 'type' => 'stripe', ], ])->assertStatus(204); $this->getJson('/api/user/subscription/invoices') ->assertStatus(200) ->assertJsonFragment([ 'customer' => $this->user['stripe_id'], ]); } }