Fixes for tests

This commit is contained in:
David Bomba 2022-03-25 17:57:53 +11:00
parent 4a3bd027ad
commit 81825cc063

View File

@ -55,10 +55,6 @@ class GeneratesConvertedQuoteCounterTest extends TestCase
public function testCounterExtraction()
{
$user = User::whereEmail('user@example.com')->first();
$user_id = $user->id;
$this->account = Account::factory()->create([
'hosted_client_count' => 1000,
'hosted_company_count' => 1000
@ -67,6 +63,18 @@ class GeneratesConvertedQuoteCounterTest extends TestCase
$this->account->num_users = 3;
$this->account->save();
$user = User::whereEmail('user@example.com')->first();
if (! $user) {
$user = User::factory()->create([
'account_id' => $this->account->id,
'confirmation_code' => $this->createDbHash(config('database.default')),
'email' => 'user@example.com',
]);
}
$user_id = $user->id;
$this->company = Company::factory()->create([
'account_id' => $this->account->id,
]);