12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace Tests\Callback\Http\Controllers;
- use Modules\Callback\Http\Controllers\JuliangAccountController;
- use PHPUnit\Framework\TestCase;
- use Tests\UsedTestCase;
- class JuliangAccountControllerTest extends UsedTestCase
- {
- public function testAddAccount()
- {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/callback/juliangAccount/addAccount', [
- 'account_id' => 1234568,
- 'account_name' => 'jkljlkj',
- 'state' => 1,
- 'protect_num' => 3,
- 'default_rate' => 50,
- 'rate_time_config' => [
- ['start_time' => '00:35', 'end_time' => '12:34', 'config_per' => 20],
- ['start_time' => '13:39', 'end_time' => '19:34', 'config_per' => 30],
- ],
- 'min_money' => 20,
- 'max_money' => 50,
- ]);
- $res->dump();
- }
- public function testupdateCallbackConfig() {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('post','http://localhost/api/callback/juliangAccount/updateCallbackConfig', [
- 'ids' => [4],
- 'state' => 1,
- 'protect_num' => 3,
- 'default_rate' => 30,
- 'rate_time_config' => [
- ['start_time' => '15:00', 'end_time' => '16:10', 'config_per' => 20],
- ['start_time' => '16:20', 'end_time' => '17:30', 'config_per' => 50],
- ['start_time' => '17:55', 'end_time' => '18:30', 'config_per' => 20],
- ],
- 'min_money' => 30,
- 'max_money' => 80,
- ]);
- $res->dump();
- }
- public function testList() {
- $res = $this->withHeaders([
- 'Authorization' => 'Bearer '. $this->token,
- ])->json('get','http://localhost/api/callback/juliangAccount/list');
- $this->dumpJson($res);
- }
- }
|