#!/usr/bin/env php domain = 'example.com'; putenv('APP_HTTPS_PORT='); r($instanceTest->urlTest($instance1)) && p() && e('//example.com'); // 步骤1:正常情况 // 步骤2:测试正常域名情况,端口为443 $instance2 = new stdClass(); $instance2->domain = 'test.example.com'; putenv('APP_HTTPS_PORT=443'); r($instanceTest->urlTest($instance2)) && p() && e('//test.example.com'); // 步骤2:端口443不添加 // 步骤3:测试正常域名情况,自定义端口8443 $instance3 = new stdClass(); $instance3->domain = 'dev.example.com'; putenv('APP_HTTPS_PORT=8443'); r($instanceTest->urlTest($instance3)) && p() && e('//dev.example.com:8443/'); // 步骤3:自定义端口 // 步骤4:测试空域名情况 $instance4 = new stdClass(); $instance4->domain = ''; putenv('APP_HTTPS_PORT='); r($instanceTest->urlTest($instance4)) && p() && e('//'); // 步骤4:空域名 // 步骤5:测试域名包含端口情况,环境变量端口为8080 $instance5 = new stdClass(); $instance5->domain = 'staging.example.com'; putenv('APP_HTTPS_PORT=8080'); r($instanceTest->urlTest($instance5)) && p() && e('//staging.example.com:8080/'); // 步骤5:端口8080