1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace Tests\Operation\Http\Controllers;
- use Modules\Operation\Http\Controllers\FirstPageController;
- use PHPUnit\Framework\TestCase;
- use Tests\UsedTestCase;
- class FirstPageControllerTest extends UsedTestCase
- {
- public function testAdd()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/operationManage/firstPage/add', [
- 'type' => 1,
- 'status' => 0,
- ]);
- $this->dumpJson($res);
- }
- public function testList()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/operationManage/firstPage/list');
- $res->dump();
- $this->dumpJson($res);
- }
- public function testEnableStatus()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/operationManage/firstPage/enableStatus', [
- 'id' => 4,
- ]);
- $res->dump();
- $this->dumpJson($res);
- }
- public function testsetConfig()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/operationManage/firstPage/setConfig', [
- 'id' => 4,
- 'duanjus' => [
- [
- 'sort' => 5,
- 'id' => 9,
- 'name' => 'xxx1',
- ],
- [
- 'sort' => 1,
- 'id' =>10,
- 'name' => 'xxx2',
- ],[
- 'sort' => 3,
- 'id' =>11,
- 'name' => 'xxx3',
- ],[
- 'sort' => 4,
- 'id' =>12,
- 'name' => 'xxx4',
- ],
- ]
- ]);
- $res->dump();
- $this->dumpJson($res);
- }
- }
|