From ab9b96d7f24baeb03f96b8e8d777c6537ab8d2ac Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 16 Sep 2024 18:52:44 +1000 Subject: [PATCH] Update .env.example vars --- app/Models/Company.php | 2 +- tests/Feature/CompanyTest.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Models/Company.php b/app/Models/Company.php index 97a567d4ef89..69957406f1d4 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -371,7 +371,7 @@ class Company extends BaseModel 'tax_data', 'e_invoice_certificate_passphrase', 'expense_mailbox_active', - 'expense_mailbox', // TODO: @turbo124 custom validation: self-hosted => free change, hosted => not changeable, only changeable with env-mask + 'expense_mailbox', 'inbound_mailbox_allow_company_users', 'inbound_mailbox_allow_vendors', 'inbound_mailbox_allow_clients', diff --git a/tests/Feature/CompanyTest.php b/tests/Feature/CompanyTest.php index 55b15b45ef67..af3ec46703ac 100644 --- a/tests/Feature/CompanyTest.php +++ b/tests/Feature/CompanyTest.php @@ -53,9 +53,11 @@ class CompanyTest extends TestCase public function testCompanyExpenseMailbox() { + $safeEmail = $this->faker->safeEmail(); + // Test valid email address $company_update = [ - 'expense_mailbox' => 'valid@example.com', + 'expense_mailbox' => $safeEmail, ]; $response = $this->withHeaders([ @@ -64,7 +66,8 @@ class CompanyTest extends TestCase ])->putJson('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $company_update); $response->assertStatus(200); - $this->assertEquals('valid@example.com', $response->json('data.expense_mailbox')); + + $this->assertEquals($safeEmail, $response->json('data.expense_mailbox')); // Test invalid email address $company_update = [