mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 05:35:08 +08:00
refactor(pay): 重构账户余额查询接口并添加单元测试
- 创建 RequestHeaderBuilder Trait 以简化请求头构建逻辑 - 在 AccountBalanceRepo 中使用 RequestHeaderBuilder Trait - 添加 QueryPointBalanceTest 单元测试用例
This commit is contained in:
24
tests/Feature/Account/QueryPointBalanceTest.php
Normal file
24
tests/Feature/Account/QueryPointBalanceTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* QueryPointBalanceTest.php@Pay
|
||||
*
|
||||
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2025/8/18
|
||||
*/
|
||||
|
||||
use Singularity\HDK\Pay\Domain\Account\Aggregate\ValueObject\PointsBalance;
|
||||
use Singularity\HDK\Pay\Domain\Account\Enum\PointType;
|
||||
use Singularity\HDK\Pay\Infratracture\Repository\AccountBalanceRepo;
|
||||
|
||||
use function Hyperf\Support\make;
|
||||
|
||||
it('should query point balance', function () {
|
||||
$uid = 'cn3221';
|
||||
$repo = make(AccountBalanceRepo::class);
|
||||
$point_balance = $repo->getPointBalance($uid, PointType::EMA);
|
||||
expect($point_balance)
|
||||
->toBeInstanceOf(PointsBalance::class)
|
||||
->and($point_balance->getType())->toBe(PointType::EMA);
|
||||
})->only();
|
||||
Reference in New Issue
Block a user