Files
portal/app/tests/Unit/Sms/OperatorNormalizerTest.php
T

26 lines
759 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
use App\Services\Sms\OperatorNormalizer;
dataset('operators', [
['МТС', 'mts'],
['ПАО "МТС"', 'mts'],
['mts', 'mts'],
['Мобильные ТелеСистемы', 'mts'],
['ВымпелКом', 'beeline'],
['ПАО ВымпелКом', 'beeline'],
['Билайн', 'beeline'],
['МегаФон', 'megafon'],
['Tele2', 'tele2'],
['Т2 Мобайл', 'tele2'],
['Yota', 'yota'],
['', ''],
['Космическая связь', ''],
]);
it('приводит имя оператора к каноническому ключу', function (string $raw, string $expected) {
expect((new OperatorNormalizer)->canonical($raw))->toBe($expected);
})->with('operators');