YinliuManageControllerTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Tests\Yinliu\Http\Controllers;
  3. use Modules\Yinliu\Http\Controllers\YinliuManageController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class YinliuManageControllerTest extends UsedTestCase
  7. {
  8. public function testSave()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('post','http://localhost/api/yinliu/manage/save', [
  13. 'id' => 1,
  14. 'focus_type' => 1,
  15. 'gzh_id' => 8,
  16. 'pop_type' => 3,
  17. 'pop_type_sub' => 1,
  18. 'link_type' => 1,
  19. 'link_url' => 'http://www.baidu.com',
  20. ]);
  21. $this->dumpJson($res);
  22. }
  23. public function testdelete()
  24. {
  25. $res = $this->withHeaders([
  26. 'Authorization' => 'Bearer '. $this->token,
  27. ])->json('post','http://localhost/api/yinliu/manage/delete', [
  28. 'id' => 1,
  29. ]);
  30. $this->dumpJson($res);
  31. }
  32. public function testlist()
  33. {
  34. $res = $this->withHeaders([
  35. 'Authorization' => 'Bearer '. $this->token,
  36. ])->json('get','http://localhost/api/yinliu/manage/list', [
  37. 'gzh_is_enabled' => 0
  38. ]);
  39. $this->dumpJson($res);
  40. }
  41. }