提交
This commit is contained in:
20
tests/upload_transport_self_check.php
Normal file
20
tests/upload_transport_self_check.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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";
|
||||
Reference in New Issue
Block a user