Refactor SupplierTest to use permission setup function and enhance phone number validation tests

- Introduced `giveSupplierPermissions` function to streamline user permission setup for supplier tests.
- Updated all supplier-related tests to utilize the new permission setup function.
- Enhanced phone number validation tests to accept various formats and special characters.
- Removed redundant tests related to unsupported phone number formats.
- Consolidated tests for supplier creation and updates to improve readability and maintainability.
This commit is contained in:
Yoga Pangestu 2026-08-22 13:46:22 +07:00
parent 7aa802445a
commit f562f2babe
5 changed files with 644 additions and 1117 deletions

View File

@ -17,7 +17,11 @@ public function handle(MessageLogged $event): void
return; return;
} }
$developers = User::role('Developer')->where('is_active', true)->get(); try {
$developers = User::role('Developer')->where('is_active', true)->get();
} catch (\Throwable) {
return;
}
if ($developers->isEmpty()) { if ($developers->isEmpty()) {
return; return;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff