ChargeTJControllerTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Tests\Statistic\Http\Controllers;
  3. use Modules\Statistic\Http\Controllers\ChargeTJController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class ChargeTJControllerTest extends UsedTestCase
  7. {
  8. public function testList()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('get','http://localhost/api/statistic/charge/list', [
  13. // 'user_id' => 10,
  14. 'limit' => 3,
  15. 'start_at' => '2023-06-03',
  16. 'end_at' => '2023-06-04',
  17. ]);
  18. // $res->dump();
  19. $this->dumpJson($res);
  20. }
  21. public function testlistTotalCharge()
  22. {
  23. $res = $this->withHeaders([
  24. 'Authorization' => 'Bearer '. $this->token,
  25. ])->json('get','http://localhost/api/statistic/charge/listTotalCharge', [
  26. // 'user_id' => 10,
  27. 'limit' => 3,
  28. 'start_at' => '2023-06-03',
  29. 'end_at' => '2023-06-04',
  30. ]);
  31. // $res->dump();
  32. $this->dumpJson($res);
  33. }
  34. public function testtodayCharge()
  35. {
  36. $res = $this->withHeaders([
  37. 'Authorization' => 'Bearer '. $this->token,
  38. ])->json('get','http://localhost/api/statistic/charge/todayCharge', [
  39. ]);
  40. // $res->dump();
  41. $this->dumpJson($res);
  42. }
  43. }