FirstPageControllerTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Tests\Operation\Http\Controllers;
  3. use Modules\Operation\Http\Controllers\FirstPageController;
  4. use PHPUnit\Framework\TestCase;
  5. use Tests\UsedTestCase;
  6. class FirstPageControllerTest extends UsedTestCase
  7. {
  8. public function testAdd()
  9. {
  10. $res = $this->withHeaders([
  11. 'Authorization' => 'Bearer '. $this->token,
  12. ])->json('post','http://localhost/api/operationManage/firstPage/add', [
  13. 'type' => 1,
  14. 'status' => 0,
  15. ]);
  16. $this->dumpJson($res);
  17. }
  18. public function testList()
  19. {
  20. $res = $this->withHeaders([
  21. 'Authorization' => 'Bearer '. $this->token,
  22. ])->json('get','http://localhost/api/operationManage/firstPage/list');
  23. $res->dump();
  24. $this->dumpJson($res);
  25. }
  26. public function testEnableStatus()
  27. {
  28. $res = $this->withHeaders([
  29. 'Authorization' => 'Bearer '. $this->token,
  30. ])->json('post','http://localhost/api/operationManage/firstPage/enableStatus', [
  31. 'id' => 4,
  32. ]);
  33. $res->dump();
  34. $this->dumpJson($res);
  35. }
  36. public function testsetConfig()
  37. {
  38. $res = $this->withHeaders([
  39. 'Authorization' => 'Bearer '. $this->token,
  40. ])->json('post','http://localhost/api/operationManage/firstPage/setConfig', [
  41. 'id' => 4,
  42. 'duanjus' => []
  43. ]);
  44. $res->dump();
  45. $this->dumpJson($res);
  46. }
  47. }