mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-02 12:17:38 +08:00
34 lines
717 B
PHP
34 lines
717 B
PHP
<?php
|
|
|
|
namespace Yansongda\Pay\Tests\Packer;
|
|
|
|
use Yansongda\Pay\Packer\QueryPacker;
|
|
|
|
class QueryPackerTest extends \Yansongda\Pay\Tests\TestCase
|
|
{
|
|
protected QueryPacker $packer;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->packer = new QueryPacker();
|
|
}
|
|
|
|
public function testPack()
|
|
{
|
|
$array = ['name' => 'yansongda', 'age' => '29'];
|
|
$str = 'name=yansongda&age=29';
|
|
|
|
self::assertEquals($str, $this->packer->pack($array));
|
|
}
|
|
|
|
public function testUnpack()
|
|
{
|
|
$array = ['name' => 'yansongda', 'age' => '29'];
|
|
$str = 'name=yansongda&age=29';
|
|
|
|
self::assertEquals($array, $this->packer->unpack($str));
|
|
}
|
|
}
|