初始化仓库
This commit is contained in:
36
vendor/alipaysdk/easysdk/php/test/payment/page/ClientTest.php
vendored
Normal file
36
vendor/alipaysdk/easysdk/php/test/payment/page/ClientTest.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Alipay\EasySDK\Kernel\Factory;
|
||||
use Alipay\EasySDK\Test\TestAccount;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ClientTest extends TestCase
|
||||
{
|
||||
public function __construct($name = null, array $data = [], $dataName = '')
|
||||
{
|
||||
parent::__construct($name, $data, $dataName);
|
||||
$account = new TestAccount();
|
||||
Factory::setOptions($account->getTestAccount());
|
||||
}
|
||||
|
||||
public function testPay()
|
||||
{
|
||||
$create = Factory::payment()->common()->create("Iphone6 16G",
|
||||
microtime(), "88.88", "2088002656718920");
|
||||
$result = Factory::payment()->page()->pay("Iphone6 16G", $create->outTradeNo, "0.10", "https://www.taobao.com");
|
||||
$this->assertEquals(true, strpos($result->body, 'alipay-easysdk-php-') > 0);
|
||||
$this->assertEquals(true, strpos($result->body, 'sign') > 0);
|
||||
}
|
||||
|
||||
public function testPayWithOptionalNotify()
|
||||
{
|
||||
$create = Factory::payment()->common()->create("Iphone6 16G",
|
||||
microtime(), "88.88", "2088002656718920");
|
||||
$result = Factory::payment()->page()
|
||||
->asyncNotify("https://www.test2.com/newCallback")
|
||||
->pay("Iphone6 16G", $create->outTradeNo, "0.10", "https://www.taobao.com");
|
||||
$this->assertEquals(true, strpos($result->body, 'alipay-easysdk-php-') > 0);
|
||||
$this->assertEquals(true, strpos($result->body, 'sign') > 0);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user