<?php

namespace Tests\Manage\Http\Controllers;

use Modules\Manage\Http\Controllers\PayConfigController;
use PHPUnit\Framework\TestCase;
use Tests\UsedTestCase;

class PayConfigControllerTest extends UsedTestCase
{

    public function testAddConfig()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('post','http://localhost/api/manage/payConfig/addConfig', [
            'name' => 'first',
            'payee_name' => 'first-payee_name',
            'pay_appid' => '12342142412',
            'pay_type' => 1,
            'pay_common_params' => [
                'aa' => 'bb',
                'bb' => 'cc',
            ],
            'miniprogram_type' => 1,
            'remark' => '111'
        ]);
        $res->dump();
        $this->dumpJson($res);
    }
    public function testRemark()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('post','http://localhost/api/manage/payConfig/remark', [
            'id' => 1,
            'remark' => 'first---',
        ]);
        $res->dump();
        $this->dumpJson($res);
    }
    public function testList()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('get','http://localhost/api/manage/payConfig/list', [

            'pay_appid' => '12342142412'
        ]);
        $res->dump();
        $this->dumpJson($res);
    }
}
