MiniprogramTest.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace Tests\Feature;
  3. use Illuminate\Foundation\Testing\RefreshDatabase;
  4. use Illuminate\Foundation\Testing\WithFaker;
  5. use Tests\TestCase;
  6. class MiniprogramTest extends TestCase
  7. {
  8. /**
  9. * php artisan test --testsuite=Feature
  10. * A basic feature test example.
  11. */
  12. public function ttest_example(): void
  13. {
  14. $response = $this->getJson('/api/manage/miniprogram/allocation/13');
  15. //$response = $this->getJson('/api/manage/miniprogram/index');
  16. echo $response->getContent();
  17. }
  18. public function test_store(): void
  19. {
  20. /*
  21. $response = $this->postJson('/api/channel/paytemplate/update/5',[
  22. 'name'=>'AAAA模板11',
  23. 'status'=>'0',
  24. 'options'=>'[{"price":9,"type":"FIRST_COIN","given":1000,"sequence":1,"is_default":0},{"price":30,"type":"COIN","given":0,"sequence":2,"is_default":1},{"price":50,"type":"COIN","given":4000,"sequence":3,"is_default":1},{"price":190,"type":"MONTH","given":0,"sequence":4,"is_default":1},{"price":290,"type":"YEAR","given":0,"sequence":5,"is_default":0}]'
  25. ]);*/
  26. $response = $this->postJson('/api/channel/paytemplate/updatePayTemplateItem/31',[
  27. 'price'=>10,'type'=>'FIRST_COIN','given'=>1000,'is_default'=>1
  28. ]);
  29. //$response = $this->postJson('/api/channel/paytemplate');
  30. echo $response->getContent();
  31. $response->dd();
  32. }
  33. public function ttest_allocation(): void
  34. {
  35. $response = $this->postJson('/api/manage/miniprogram/allocation/17',[
  36. 'uids'=>'2,5',
  37. 'action'=>'on'
  38. ]);
  39. $response->dd();
  40. }
  41. public function test_index(): void
  42. {
  43. $name = '亿';
  44. $response = $this->getJson('/api/channel/paytemplate/show/5');
  45. //$response = $this->getJson('/api/channel/paytemplate/optionSequence');
  46. echo $response->getContent();
  47. $response->dd();
  48. }
  49. }