mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Fixes for seeder
This commit is contained in:
parent
ec559ff16e
commit
19a991e4c3
@ -14,7 +14,7 @@ return new class extends Migration
|
||||
{
|
||||
$t = \App\Models\Timezone::find(115);
|
||||
|
||||
if(!$t){
|
||||
if(!$t && \App\Models\Timezone::count() > 1){
|
||||
|
||||
$t = new Timezone();
|
||||
$t->id = 115;
|
||||
|
@ -12,13 +12,15 @@
|
||||
|
||||
namespace Tests\Feature\Account;
|
||||
|
||||
use App\DataMapper\ClientRegistrationFields;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Tests\TestCase;
|
||||
use App\Models\User;
|
||||
use App\Utils\Ninja;
|
||||
use App\Models\Account;
|
||||
use App\Models\Company;
|
||||
use App\Utils\Ninja;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Factory\CompanyUserFactory;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Tests\TestCase;
|
||||
use App\DataMapper\ClientRegistrationFields;
|
||||
|
||||
class AccountEmailQuotaTest extends TestCase
|
||||
{
|
||||
@ -50,6 +52,20 @@ class AccountEmailQuotaTest extends TestCase
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
$hash = \Illuminate\Support\Str::random(32);
|
||||
|
||||
$user = User::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => $hash,
|
||||
'email' => "{$hash}@example.com",
|
||||
]);
|
||||
|
||||
$cu = CompanyUserFactory::create($user->id, $company->id, $account->id);
|
||||
$cu->is_owner = true;
|
||||
$cu->is_admin = true;
|
||||
$cu->is_locked = false;
|
||||
$cu->save();
|
||||
|
||||
$company->client_registration_fields = ClientRegistrationFields::generate();
|
||||
|
||||
$settings = CompanySettings::defaults();
|
||||
|
@ -95,7 +95,7 @@ class ArDetailReportTest extends TestCase
|
||||
$settings->client_online_payment_notification = false;
|
||||
$settings->client_manual_payment_notification = false;
|
||||
$settings->currency_id = '1';
|
||||
|
||||
|
||||
$this->company = Company::factory()->create([
|
||||
'account_id' => $this->account->id,
|
||||
'settings' => $settings,
|
||||
|
Loading…
Reference in New Issue
Block a user