#!/usr/bin/env php agentId = '123456789'; $normalWebhook->appKey = 'testappkey'; $normalWebhook->appSecret = 'testappsecret'; r($webhookTest->getDingdingSecretTest($normalWebhook)) && p('url') && e('https://oapi.dingtalk.com/'); // 缺少agentId $missingAgentId = new stdClass(); $missingAgentId->agentId = ''; $missingAgentId->appKey = 'testappkey'; $missingAgentId->appSecret = 'testappsecret'; r($webhookTest->getDingdingSecretTest($missingAgentId)) && p('agentId') && e('『钉钉AgentId』不能为空。'); // 缺少appKey $missingAppKey = new stdClass(); $missingAppKey->agentId = '123456789'; $missingAppKey->appKey = ''; $missingAppKey->appSecret = 'testappsecret'; r($webhookTest->getDingdingSecretTest($missingAppKey)) && p('appKey') && e('『钉钉AppKey』不能为空。'); // 缺少appSecret $missingAppSecret = new stdClass(); $missingAppSecret->agentId = '123456789'; $missingAppSecret->appKey = 'testappkey'; $missingAppSecret->appSecret = ''; r($webhookTest->getDingdingSecretTest($missingAppSecret)) && p('appSecret') && e('『钉钉AppSecret』不能为空。'); // 所有参数都为空 $emptyWebhook = new stdClass(); $emptyWebhook->agentId = ''; $emptyWebhook->appKey = ''; $emptyWebhook->appSecret = ''; r($webhookTest->getDingdingSecretTest($emptyWebhook)) && p('agentId') && e('『钉钉AgentId』不能为空。');