TransactionServiceTest.php 677 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace SixShop\Lakala\Service;
  3. use PHPUnit\Framework\TestCase;
  4. use SixShop\Lakala\Dto\LocationInfo;
  5. use SixShop\Payment\Enum\NumberBizEnum;
  6. class TransactionServiceTest extends TestCase
  7. {
  8. private TransactionService $transactionService;
  9. protected function setUp(): void
  10. {
  11. $this->transactionService = app(TransactionService::class);
  12. }
  13. public function testPreOrder()
  14. {
  15. $this->transactionService->preOrder(
  16. outTradeNo: generate_number(NumberBizEnum::ORDER_PAY),
  17. totalAmount: .01,
  18. locationInfo: new LocationInfo(requestIP: '127.0.0.1'),
  19. subject: '测试订单',
  20. );
  21. }
  22. }