Adjustments for tests and email validation

This commit is contained in:
David Bomba 2025-11-10 16:38:07 +11:00
parent 1c9fa73d35
commit 30dfcb01c8
3 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class UpdateUserRequest extends Request
'password' => 'nullable|string|min:6', 'password' => 'nullable|string|min:6',
]; ];
$rules['email'] = ['email:rfc,dns', 'bail', 'sometimes', new UniqueUserRule($this->user, $input['email'])]; $rules['email'] = ['email:rfc', 'bail', 'sometimes', new UniqueUserRule($this->user, $input['email'])];
if (Ninja::isHosted() && $this->phone_has_changed && $this->phone && isset($this->phone)) { if (Ninja::isHosted() && $this->phone_has_changed && $this->phone && isset($this->phone)) {
$rules['phone'] = ['sometimes', 'bail', 'string', new HasValidPhoneNumber()]; $rules['phone'] = ['sometimes', 'bail', 'string', new HasValidPhoneNumber()];

View File

@ -147,6 +147,7 @@ class UserTest extends TestCase
$data = $user->toArray(); $data = $user->toArray();
nlog($data);
$response = $this->withHeaders([ $response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'), 'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $company_token->token, 'X-API-TOKEN' => $company_token->token,

View File

@ -2,6 +2,8 @@
namespace Tests; namespace Tests;
define('LARAVEL_START', microtime(true));
use Mockery; use Mockery;
use App\Utils\Traits\AppSetup; use App\Utils\Traits\AppSetup;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
@ -13,6 +15,7 @@ abstract class TestCase extends BaseTestCase
protected function setUp(): void protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
} }