chengkun
2025-09-19 d48eff069585e2be1bd02b1299e1fe7581cb6dad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
 
 
namespace Alipay\EasySDK\Test\marketing\templatemessage;
 
 
use Alipay\EasySDK\Kernel\Factory;
use Alipay\EasySDK\Test\TestAccount;
use PHPUnit\Framework\TestCase;
 
class ClientTest extends TestCase
{
    public function testSend(){
        $account = new TestAccount();
        Factory::setOptions($account->getTestAccount());
        $result = Factory::marketing()->templateMessage()->send("2088102122458832",
            "2017010100000000580012345678",
            "MDI4YzIxMDE2M2I5YTQzYjUxNWE4MjA4NmU1MTIyYmM=",
            "page/component/index",
            "{\"keyword1\": {\"value\" : \"12:00\"},\"keyword2\": {\"value\" : \"20180808\"},\"keyword3\": {\"value\" : \"支付宝\"}}");
        $this->assertEquals('40004',$result->code);
        $this->assertEquals('Business Failed',$result->msg);
        $this->assertEquals('USER_TEMPLATE_ILLEGAL',$result->subCode);
        $this->assertEquals('模板非法',$result->subMsg);
    }
 
}