<?php

namespace Tests\Jiesuan\Http\Controllers;

use Modules\Jiesuan\Http\Controllers\BankAccountController;
use PHPUnit\Framework\TestCase;
use Tests\UsedTestCase;

class BankAccountControllerTest extends UsedTestCase
{

    public function testHezuoInfo()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('get','http://localhost/api/jiesuanManage/bankAccount/hezuoInfo', []);
//        $res->dump();
        $this->dumpJson($res);
    }
    public function testaddCompanyCard()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('post','http://localhost/api/jiesuanManage/bankAccount/addCompanyCard', [
            'owner_name' => 'fsdadfasfsaf',
            'name_of_payee' => 'jlkjkljklj',
            'card_no' => '21432515',
            'bank_name' => '中国银行',
            'sub_bank_name' => '第一支行',
            'phone_of_payee' => '143214141',
            'business_id' => 8
        ]);
        $res->dump();

        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('post','http://localhost/api/jiesuanManage/bankAccount/addCompanyCard', [
            'id' => 1,
            'owner_name' => 'fsdadfasfsaf2222',
            'name_of_payee' => 'jlkjkljklj3333',
            'card_no' => '2143251544',
            'bank_name' => '中国银行',
            'sub_bank_name' => '第一支行22',
            'phone_of_payee' => '14321414123323232',
            'business_id' => 8
        ]);
        $res->dump();
    }

    public function testaddCompanyCard1() {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('post','http://localhost/api/jiesuanManage/bankAccount/addCompanyCard', [
            'id' => 1,
            'owner_name' => 'fasd',
            'name_of_payee' => 'fdsa',
            'card_no' => '2143251544',
            'bank_name' => '中国银行',
            'sub_bank_name' => '第一支行22',
            'phone_of_payee' => '1231',
            'business_id' => 8
        ]);
        $res->dump();
    }

    public function testlistShangwu()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('get','http://localhost/api/jiesuanManage/bankAccount/listShangwu');
//        $res->dump();
        $this->dumpJson($res);
    }
    public function testlistBank()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('get','http://localhost/api/jiesuanManage/bankAccount/listBank');
//        $res->dump();
        $this->dumpJson($res);
    }

    public function testlistCompanyCard()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('get','http://localhost/api/jiesuanManage/bankAccount/listCompanyCard');
//        $res->dump();
        $this->dumpJson($res);
    }
    public function testlistAvailableBankCard()
    {
        $res = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->json('get','http://localhost/api/jiesuanManage/bankAccount/listAvailableBankCard');
//        $res->dump();
        $this->dumpJson($res);
    }


}
