Issues (42)

tests/WechatTest.php (1 issue)

Labels
Severity
1
<?php
2
3
use PHPUnit\Framework\TestCase;
4
use tinymeng\Chinaums\Factory;
5
6
/**
7
 * IntelligentParseTest
8
 */
9
class WechatTest extends TestCase
10
{
11
    public function testAddress()
12
    {
13
        $data = [];
14
        // 报文请求时间
15
        $data['requestTimestamp'] = date("YmdHis", time());
16
        // 订单号
17
        $data['merOrderId'] = '33XF'.time() . uniqid();
18
        // 业务类型 机构商户号 MINIDEFAULT|QRPAYDEFAULT|YUEDANDEFAULT
19
        $data['instMid'] = 'MINIDEFAULT';
20
        // 订单描述 展示在支付截图中
21
        $data['orderDesc'] = '账单描述';
22
        // 支付总金额
23
        $data['totalAmount'] = 2;
24
        // 微信必填
25
        $data['subAppId'] = 'wxca3a56d63895b431';
26
        // 微信必填  前端获取用户的openid 传给后台
27
        $data['subOpenId'] = 'o4Sic5HPuB3j-LmnQTVIC4G_oYqY';
28
        $data['tradeType'] = 'JSAPI';
29
30
        $config = [
31
            'mid' => '8982****5678',// 商户号
32
            'tid' => '88****01',// 终端号
33
            'appid' => '10037e6****5e5a0006',// 加密 APPID
34
            'appkey' => '1c4e3b1606****6a09e5b312e8',// 加密 KEY
35
            'md5key' => 'impA***********hCaTCXJ6'// 回调验证需要的md5key
36
        ];
37
        Factory::config($config);
38
        $app = Factory::Wechat()->mini();
0 ignored issues
show
The call to tinymeng\Chinaums\Provider\Wechat::Mini() has too few arguments starting with params. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        $app = Factory::Wechat()->/** @scrutinizer ignore-call */ mini();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
39
        $reponse = $app->request($data);
40
        echo 'response:' . $reponse . PHP_EOL;
41
    }
42
43
}