08d51eb6c8
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
575 B
PHP
18 lines
575 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Support\PhoneNormalizer;
|
|
|
|
it('normalizes russian phones to +7XXXXXXXXXX', function (string $input, ?string $expected) {
|
|
expect(PhoneNormalizer::normalize($input))->toBe($expected);
|
|
})->with([
|
|
['+7 (915) 123-45-67', '+79151234567'],
|
|
['8 915 123 45 67', '+79151234567'],
|
|
['9151234567', '+79151234567'],
|
|
['7(915)1234567', '+79151234567'],
|
|
['123', null],
|
|
['+1 202 555 0143', null], // 11 цифр, но начинается не с 7/8
|
|
['', null],
|
|
]);
|