Files
miniapi/tests/upload_transport_self_check.php
gaofeng e0aeff2af7 提交
2026-09-01 11:07:13 +08:00

21 lines
820 B
PHP

<?php
declare(strict_types=1);
$source = file_get_contents(__DIR__ . '/../app/service/SwooleService.php');
if (!is_string($source)) {
throw new RuntimeException('Unable to read upload transport');
}
if (!str_contains($source, "private string \$host = 'ossup.jzvisa.cn';")) {
throw new RuntimeException('Upload transport must use ossup.jzvisa.cn');
}
if (!str_contains($source, 'private int $port = 19501;')) {
throw new RuntimeException('Upload transport must keep port 19501');
}
$controller = file_get_contents(__DIR__ . '/../app/miniapi/controller/Upload.php');
if (!is_string($controller) || !str_contains($controller, "'json_encode_param' => 0")) {
throw new RuntimeException('Upload responses must escape Unicode for wx.uploadFile compatibility');
}
echo "Upload transport self-check passed\n";