提交
This commit is contained in:
@@ -9,8 +9,8 @@ require dirname(__DIR__) . '/app/miniapi/service/VisaApplication/VisaApplication
|
||||
use app\miniapi\service\VisaApplication\VisaApplicationService;
|
||||
|
||||
$service = new VisaApplicationService();
|
||||
if ($service->endpoint('https://user.example.com/users/list', 'start') !== 'https://user.example.com/visa_application/start') throw new RuntimeException('endpoint construction failed');
|
||||
if ($service->endpoint('https://user.example.com/users/list', 'dataSource') !== 'https://user.example.com/visa_application/dataSource') throw new RuntimeException('data source forwarding endpoint failed');
|
||||
if ($service->endpoint('https://user.example.com/users/list', 'start') !== 'https://user.example.com/visa_service/start') throw new RuntimeException('endpoint construction failed');
|
||||
if ($service->endpoint('https://user.example.com/users/list', 'dataSource') !== 'https://user.example.com/visa_service/dataSource') throw new RuntimeException('data source forwarding endpoint failed');
|
||||
if ($service->endpoint('https://user.example.com/users/list', 'invalid') !== '') throw new RuntimeException('action allowlist failed');
|
||||
$payload = $service->payload(9, ['order_source' => 'jnwxmini']);
|
||||
if (isset($payload['user_id']) || (json_decode((string)($payload['user_token'] ?? ''), true) !== ['purpose' => 'visa_api', 'user_id' => 9, 'order_source' => 'jnwxmini'])) throw new RuntimeException('trusted token payload failed');
|
||||
|
||||
Reference in New Issue
Block a user