<?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' => []
        ]);
        $res->dump();
        $this->dumpJson($res);
    }


}