CommonTest.php 756 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Tests\Unit;
  3. use GuzzleHttp\Client;
  4. class CommonTest extends \Tests\TestCase
  5. {
  6. protected Client $client;
  7. protected string $baseUrl = ''; // 修改为实际运行的服务器地址
  8. public function setUp(): void
  9. { parent::setUp();
  10. $this->baseUrl = env('UNITTEST_URL', 'http://localhost:8000');
  11. $this->client = new Client([
  12. 'base_uri' => $this->baseUrl,
  13. 'timeout' => 5.0,
  14. 'http_errors' => false,
  15. 'verify' => false // 禁用 SSL 验证
  16. ]);
  17. }
  18. public function testA()
  19. {
  20. }
  21. }