29 lines
781 B
PHP
29 lines
781 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Esun\LingxingErp\Test\Unit\Model\Api;
|
|
|
|
use Esun\LingxingErp\Model\Api\Signer;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class SignerTest extends TestCase
|
|
{
|
|
public function testMatchesLingxingPhpSdkSerializationAndEncryption(): void
|
|
{
|
|
$parameters = [
|
|
'z' => null,
|
|
'items' => [['sku' => '测试/1', 'qty' => 2, 'drop' => null]],
|
|
'empty' => '',
|
|
'bool' => true,
|
|
'access_token' => 'token',
|
|
'app_key' => 'ak_test123456789',
|
|
'timestamp' => 1720408272,
|
|
];
|
|
|
|
self::assertSame(
|
|
'mR8XKYkL8QUYDIJmM75XAl3JGPuuDvzjsyr6LZ5nWocwCpgLHg5dzZDMNuiTX/Va',
|
|
(new Signer())->sign($parameters, 'ak_test123456789')
|
|
);
|
|
}
|
|
}
|