TestHttp.php 668 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. define('APP_ID', 'test');
  4. define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
  5. require_once(BASE_ROOT_PATH . '/global.php');
  6. require_once(BASE_CORE_PATH . '/lrlz.php');
  7. require_once(BASE_ROOT_PATH . '/fooder.php');
  8. require_once(BASE_CORE_PATH . '/framework/function/http.php');
  9. class TestHttp extends TestCase
  10. {
  11. public static function setUpBeforeClass(): void
  12. {
  13. Base::run_util();
  14. }
  15. public function testRequest()
  16. {
  17. Log::record(__METHOD__,Log::DEBUG);
  18. for ($i = 0; $i < 10000; $i++) {
  19. $rsp = http_request("http://test.xyzshops.cn");
  20. }
  21. }
  22. }