mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-03 12:48:24 +08:00
35 lines
836 B
PHP
35 lines
836 B
PHP
<?php
|
|
|
|
namespace Yansongda\Pay\Tests\Plugin\Alipay\V2;
|
|
|
|
use Yansongda\Pay\Plugin\Alipay\V2\ResponseInvokeStringPlugin;
|
|
use Yansongda\Artful\Rocket;
|
|
use Yansongda\Pay\Tests\TestCase;
|
|
|
|
class ResponseInvokeStringPluginTest extends TestCase
|
|
{
|
|
private ResponseInvokeStringPlugin $plugin;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->plugin = new ResponseInvokeStringPlugin();
|
|
}
|
|
|
|
public function testNormal()
|
|
{
|
|
$payload = [
|
|
'name' => "yansongda",
|
|
'age' => 30,
|
|
];
|
|
|
|
$rocket = new Rocket();
|
|
$rocket->mergePayload($payload);
|
|
|
|
$result = $this->plugin->assembly($rocket, function ($rocket) {return $rocket;});
|
|
|
|
self::assertEquals(http_build_query($payload), $result->getDestination()->getBody()->getContents());
|
|
}
|
|
}
|