mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 12:34:13 +00:00
5df307a165
updated seeder to be informative fix seeder error on test
38 lines
758 B
PHP
38 lines
758 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use App\User;
|
|
use App\SettingCredit;
|
|
use App\Role;
|
|
use Artisan;
|
|
|
|
class SettingCreditTest extends TestCase
|
|
{
|
|
protected $user;
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
Artisan::call('db:seed');
|
|
|
|
$this->user = factory(User::class)->create();
|
|
$this->user->attachRole(Role::Where('name','admin')->first());
|
|
}
|
|
|
|
public function testStore(){
|
|
|
|
$this->actingAs($this->user)
|
|
->putJson('/api/setting-credit/', [
|
|
'rmb_credit_limit' => '5000',
|
|
'usd_credit_limit' => '2000',
|
|
'time_limit' => '500'
|
|
])
|
|
->assertStatus(200);
|
|
}
|
|
|
|
}
|