#!/usr/bin/env php wechatCorpId = 'wxcorp123456789'; $normalWebhook->wechatCorpSecret = 'wechat_secret_123456789'; $normalWebhook->wechatAgentId = '1000001'; r($webhookTest->getWeixinSecretTest($normalWebhook)) && p('url') && e('https://qyapi.weixin.qq.com/cgi-bin/'); // 缺少企业ID $missingCorpId = new stdClass(); $missingCorpId->wechatCorpId = ''; $missingCorpId->wechatCorpSecret = 'wechat_secret_123456789'; $missingCorpId->wechatAgentId = '1000001'; r($webhookTest->getWeixinSecretTest($missingCorpId)) && p('wechatCorpId') && e('『企业ID』不能为空。'); // 缺少企业秘钥 $missingCorpSecret = new stdClass(); $missingCorpSecret->wechatCorpId = 'wxcorp123456789'; $missingCorpSecret->wechatCorpSecret = ''; $missingCorpSecret->wechatAgentId = '1000001'; r($webhookTest->getWeixinSecretTest($missingCorpSecret)) && p('wechatCorpSecret') && e('『应用的凭证密钥』不能为空。'); // 缺少应用ID $missingAgentId = new stdClass(); $missingAgentId->wechatCorpId = 'wxcorp123456789'; $missingAgentId->wechatCorpSecret = 'wechat_secret_123456789'; $missingAgentId->wechatAgentId = ''; r($webhookTest->getWeixinSecretTest($missingAgentId)) && p('wechatAgentId') && e('『企业应用的ID』不能为空。'); // 所有参数都为空 $emptyWebhook = new stdClass(); $emptyWebhook->wechatCorpId = ''; $emptyWebhook->wechatCorpSecret = ''; $emptyWebhook->wechatAgentId = ''; r($webhookTest->getWeixinSecretTest($emptyWebhook)) && p('wechatCorpId') && e('『企业ID』不能为空。');