PayConfigControllerTest.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Tests\Manage\Http\Controllers;
  3. use Modules\Manage\Http\Controllers\PayConfigController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class PayConfigControllerTest extends UsedTestCase
  7. {
  8. public function testAddConfig()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('post','http://localhost/api/manage/payConfig/addConfig', [
  13. 'name' => 'first',
  14. 'payee_name' => 'first-payee_name',
  15. 'pay_appid' => '12342142412',
  16. 'pay_type' => 1,
  17. 'pay_common_params' => [
  18. 'aa' => 'bb',
  19. 'bb' => 'cc',
  20. ],
  21. 'miniprogram_type' => 1,
  22. 'remark' => '111'
  23. ]);
  24. $res->dump();
  25. $this->dumpJson($res);
  26. }
  27. public function testRemark()
  28. {
  29. $res = $this->withHeaders([
  30. 'Authorization' => 'Bearer '. $this->token,
  31. ])->json('post','http://localhost/api/manage/payConfig/remark', [
  32. 'id' => 1,
  33. 'remark' => 'first---',
  34. ]);
  35. $res->dump();
  36. $this->dumpJson($res);
  37. }
  38. public function testList()
  39. {
  40. $res = $this->withHeaders([
  41. 'Authorization' => 'Bearer '. $this->token,
  42. ])->json('get','http://localhost/api/manage/payConfig/list', [
  43. 'pay_appid' => '12342142412'
  44. ]);
  45. $res->dump();
  46. $this->dumpJson($res);
  47. }
  48. }