expectException(ApiException::class); $this->expectExceptionMessage('相对路径'); $client->send('GET', 'https://example.com/evil'); } /** * 测试 JSON 客户端拒绝网络路径 URL。 */ public function testSendRejectsNetworkPathUri(): void { $client = new JsonClient(); $this->expectException(ApiException::class); $this->expectExceptionMessage('相对路径'); $client->send('GET', '//example.com/evil'); } }