Fixes for tests

This commit is contained in:
David Bomba 2025-03-25 11:45:46 +11:00
parent 2f1cabd181
commit 987e262ac5
4 changed files with 10 additions and 9 deletions

View File

@ -83,10 +83,10 @@ class StoreClientRequest extends Request
$rules['shipping_country_id'] = 'integer|nullable|exists:countries,id';
$rules['number'] = ['sometimes', 'nullable', 'bail', Rule::unique('clients')->where('company_id', $user->company()->id)];
$rules['country_id'] = 'integer|nullable|exists:countries,id';
$rules['custom_value1'] = 'bail|nullable|string';
$rules['custom_value2'] = 'bail|nullable|string';
$rules['custom_value3'] = 'bail|nullable|string';
$rules['custom_value4'] = 'bail|nullable|string';
$rules['custom_value1'] = 'bail|nullable|sometimes|string';
$rules['custom_value2'] = 'bail|nullable|sometimes|string';
$rules['custom_value3'] = 'bail|nullable|sometimes|string';
$rules['custom_value4'] = 'bail|nullable|sometimes|string';
return $rules;
}

View File

@ -83,10 +83,10 @@ class UpdateClientRequest extends Request
//'regex:/[@$!%*#?&.]/', // must contain a special character
];
$rules['custom_value1'] = 'bail|nullable|string';
$rules['custom_value2'] = 'bail|nullable|string';
$rules['custom_value3'] = 'bail|nullable|string';
$rules['custom_value4'] = 'bail|nullable|string';
$rules['custom_value1'] = 'bail|nullable|sometimes|string';
$rules['custom_value2'] = 'bail|nullable|sometimes|string';
$rules['custom_value3'] = 'bail|nullable|sometimes|string';
$rules['custom_value4'] = 'bail|nullable|sometimes|string';
return $rules;
}

View File

@ -32,7 +32,7 @@ class ClientFactory extends Factory
'paid_to_date' => 0,
'vat_number' => $this->faker->numberBetween(123456789, 987654321),
'id_number' => $this->faker->iban(),
'custom_value1' => $this->faker->dateTime(),
'custom_value1' => $this->faker->date(),
'custom_value2' => $this->faker->colorName(),
'custom_value3' => $this->faker->word(),
'custom_value4' => $this->faker->email(),

View File

@ -74,6 +74,7 @@ class ClassificationTest extends TestCase
{
$this->client->classification = 'business';
nlog($this->client->toArray());
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->token,