fixes for tests

This commit is contained in:
David Bomba 2020-06-27 12:35:11 +10:00
parent 168750183b
commit e6bc63b2c2
3 changed files with 4 additions and 3 deletions

View File

@ -120,7 +120,7 @@ class AuthorizeCreditCard
$payment->client_id = $this->authorize->client->id;
$payment->company_gateway_id = $this->authorize->company_gateway->id;
$payment->status_id = Payment::STATUS_COMPLETED;
$payment->gateway_type_id = $this->authorize->payment_method;
$payment->gateway_type_id = GatewayType::CREDIT_CARD;
$payment->type_id = PaymentType::CREDIT_CARD_OTHER;
$payment->currency_id = $this->authorize->client->getSetting('currency_id');
$payment->date = Carbon::now();

View File

@ -96,7 +96,7 @@ class UserTest extends TestCase
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,
'X-API-PASSWORD' => 'ALongAndBriliantPassword',
'X-API-PASSWORD' => 'ALongAndBriliantPassword',
])->post('/api/v1/users/'.$this->encodePrimaryKey($user->id).'/attach_to_company?include=company_user');
$response->assertStatus(200);

View File

@ -120,11 +120,12 @@ trait MockAccountData
if (!$this->user) {
$this->user = factory(\App\Models\User::class)->create([
'account_id' => $this->account->id,
'password' => Hash::make('ALongAndBriliantPassword'),
'confirmation_code' => $this->createDbHash(config('database.default'))
]);
}
$this->user->password = Hash::make('ALongAndBriliantPassword');
$cu = CompanyUserFactory::create($this->user->id, $this->company->id, $this->account->id);
$cu->is_owner = true;
$cu->is_admin = true;