Skip to content

Commit 0c11363

Browse files
committed
fix tests and config
1 parent c37e034 commit 0c11363

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

config/laravel-validate.php

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,29 @@
1919
use Milwad\LaravelValidate\Utils\CountryPhoneValidator\ZHPhoneValidator;
2020

2121
return [
22+
/*
23+
* Mapping of country codes to their respective phone number validator classes.
24+
* Each validator enforces country-specific phone number formatting and validation rules.
25+
*
26+
* You can add custom country phone validator.
27+
*/
2228
'phone-country' => [
23-
'DE' => DEPhoneValidator::class,
24-
'EN' => ENPhoneValidator::class,
25-
'ES' => ESPhoneValidator::class,
26-
'FR' => FRPhoneValidator::class,
27-
'GR' => GRPhoneValidator::class,
28-
'ID' => IDPhoneValidator::class,
29-
'IN' => INPhoneValidator::class,
30-
'IR' => IRPhoneValidator::class,
31-
'IT' => ITPhoneValidator::class,
32-
'JA' => JAPhoneValidator::class,
33-
'KO' => KOPhoneValidator::class,
34-
'NE' => NEPhoneValidator::class,
35-
'RU' => RUPhoneValidator::class,
36-
'SA' => SAPhoneValidator::class,
37-
'SE' => SEPhoneValidator::class,
38-
'TR' => TRPhoneValidator::class,
39-
'ZH' => ZHPhoneValidator::class,
29+
'DE' => DEPhoneValidator::class, // Germany
30+
'EN' => ENPhoneValidator::class, // England
31+
'ES' => ESPhoneValidator::class, // Spain
32+
'FR' => FRPhoneValidator::class, // France
33+
'GR' => GRPhoneValidator::class, // Greece
34+
'ID' => IDPhoneValidator::class, // Indonesia
35+
'IN' => INPhoneValidator::class, // India
36+
'IR' => IRPhoneValidator::class, // Iran
37+
'IT' => ITPhoneValidator::class, // Italy
38+
'JA' => JAPhoneValidator::class, // Japan
39+
'KO' => KOPhoneValidator::class, // South Korea
40+
'NE' => NEPhoneValidator::class, // Netherlands
41+
'RU' => RUPhoneValidator::class, // Russia
42+
'SA' => SAPhoneValidator::class, // Saudi Arabia
43+
'SE' => SEPhoneValidator::class, // Sweden
44+
'TR' => TRPhoneValidator::class, // Turkey
45+
'ZH' => ZHPhoneValidator::class, // China
4046
],
4147
];

tests/LaravelValidateServiceProviderTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Milwad\LaravelValidate\Tests;
44

5+
use Illuminate\Support\Facades\File;
6+
use Illuminate\Support\Str;
57
use Milwad\LaravelValidate\LaravelValidateServiceProvider;
68

79
class LaravelValidateServiceProviderTest extends TestCase
@@ -11,9 +13,13 @@ class LaravelValidateServiceProviderTest extends TestCase
1113
*/
1214
public function test_all_lang_folders_publish_successfully()
1315
{
14-
$langs = (new LaravelValidateServiceProvider(app()))->langs;
16+
$langs = File::directories(__DIR__ . '/../src/lang');
1517

1618
foreach ($langs as $lang) {
19+
$lang = Str::after($lang, "lang");
20+
$lang = Str::replace('\\', '', $lang);
21+
$lang = Str::replace('/', '', $lang);
22+
1723
$this->artisan('vendor:publish', [
1824
'--tag' => "validate-lang-$lang",
1925
]);

0 commit comments

Comments
 (0)