url(), PHP_URL_PATH); if ($path === '/customers' && $request->method() === 'POST') { return Http::response([ 'data' => ['id' => 'cus_456'], ], 200); } if ($path === '/transactions' && $request->method() === 'GET') { return Http::response([ 'data' => [], 'meta' => [ 'pagination' => [ 'next' => null, 'previous' => null, 'has_more' => false, ], ], ], 200); } return Http::response([], 404); }); $this->tenant->forceFill(['paddle_customer_id' => null])->save(); $response = $this->authenticatedRequest('GET', '/api/v1/tenant/billing/transactions'); $response->assertOk(); $response->assertJsonPath('data', []); $this->assertDatabaseHas('tenants', [ 'id' => $this->tenant->id, 'paddle_customer_id' => 'cus_456', ]); } }