mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 06:44:37 -04: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);
|
$t = \App\Models\Timezone::find(115);
|
||||||
|
|
||||||
if(!$t){
|
if(!$t && \App\Models\Timezone::count() > 1){
|
||||||
|
|
||||||
$t = new Timezone();
|
$t = new Timezone();
|
||||||
$t->id = 115;
|
$t->id = 115;
|
||||||
|
@ -12,13 +12,15 @@
|
|||||||
|
|
||||||
namespace Tests\Feature\Account;
|
namespace Tests\Feature\Account;
|
||||||
|
|
||||||
use App\DataMapper\ClientRegistrationFields;
|
use Tests\TestCase;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\Models\User;
|
||||||
|
use App\Utils\Ninja;
|
||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Utils\Ninja;
|
use App\DataMapper\CompanySettings;
|
||||||
|
use App\Factory\CompanyUserFactory;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Tests\TestCase;
|
use App\DataMapper\ClientRegistrationFields;
|
||||||
|
|
||||||
class AccountEmailQuotaTest extends TestCase
|
class AccountEmailQuotaTest extends TestCase
|
||||||
{
|
{
|
||||||
@ -50,6 +52,20 @@ class AccountEmailQuotaTest extends TestCase
|
|||||||
'account_id' => $account->id,
|
'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();
|
$company->client_registration_fields = ClientRegistrationFields::generate();
|
||||||
|
|
||||||
$settings = CompanySettings::defaults();
|
$settings = CompanySettings::defaults();
|
||||||
|
@ -95,7 +95,7 @@ class ArDetailReportTest extends TestCase
|
|||||||
$settings->client_online_payment_notification = false;
|
$settings->client_online_payment_notification = false;
|
||||||
$settings->client_manual_payment_notification = false;
|
$settings->client_manual_payment_notification = false;
|
||||||
$settings->currency_id = '1';
|
$settings->currency_id = '1';
|
||||||
|
|
||||||
$this->company = Company::factory()->create([
|
$this->company = Company::factory()->create([
|
||||||
'account_id' => $this->account->id,
|
'account_id' => $this->account->id,
|
||||||
'settings' => $settings,
|
'settings' => $settings,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user