diff --git a/src/PhoneNumberOneLine.php b/src/PhoneNumberShortcuts.php similarity index 97% rename from src/PhoneNumberOneLine.php rename to src/PhoneNumberShortcuts.php index 7b8a70a..028a588 100644 --- a/src/PhoneNumberOneLine.php +++ b/src/PhoneNumberShortcuts.php @@ -4,7 +4,7 @@ use libphonenumber\PhoneNumberUtil; -class PhoneNumberOneLine +class PhoneNumberShortcuts { public const E164 = 0; public const INTERNATIONAL = 1; diff --git a/tests/FormatTest.php b/tests/FormatTest.php index 12f9ccd..f816bdc 100644 --- a/tests/FormatTest.php +++ b/tests/FormatTest.php @@ -5,34 +5,34 @@ use PHPUnit\Framework\TestCase; /** - * @covers \PhoneNumberOneLine + * @covers \PhoneNumberShortcuts */ class FormatTest extends TestCase { public static function testException(): void { - $result = \PhoneNumberOneLine::format('itsnotanumber', PhoneNumberOneLine::E164, 'FR'); + $result = \PhoneNumberShortcuts::format('itsnotanumber', PhoneNumberShortcuts::E164, 'FR'); self::assertNull($result); } public static function testFormatWithRegion(): void { - $result = \PhoneNumberOneLine::format('0605040302', PhoneNumberOneLine::E164, 'FR'); + $result = \PhoneNumberShortcuts::format('0605040302', PhoneNumberShortcuts::E164, 'FR'); self::assertSame($result, '+33605040302'); - $result = \PhoneNumberOneLine::format('0605040302', PhoneNumberOneLine::NATIONAL, 'FR'); + $result = \PhoneNumberShortcuts::format('0605040302', PhoneNumberShortcuts::NATIONAL, 'FR'); self::assertSame($result, '06 05 04 03 02'); - $result = \PhoneNumberOneLine::format('0605040302', PhoneNumberOneLine::INTERNATIONAL, 'FR'); + $result = \PhoneNumberShortcuts::format('0605040302', PhoneNumberShortcuts::INTERNATIONAL, 'FR'); self::assertSame($result, '+33 6 05 04 03 02'); - $result = \PhoneNumberOneLine::format('0605040302', PhoneNumberOneLine::RFC3966, 'FR'); + $result = \PhoneNumberShortcuts::format('0605040302', PhoneNumberShortcuts::RFC3966, 'FR'); self::assertSame($result, 'tel:+33-6-05-04-03-02'); } public static function testFormatWithoutRegion(): void { - $result = \PhoneNumberOneLine::format('+33605040302', PhoneNumberOneLine::NATIONAL); + $result = \PhoneNumberShortcuts::format('+33605040302', PhoneNumberShortcuts::NATIONAL); self::assertSame($result, '06 05 04 03 02'); } } diff --git a/tests/RegionTest.php b/tests/RegionTest.php index 4e59506..e9f42bf 100644 --- a/tests/RegionTest.php +++ b/tests/RegionTest.php @@ -5,22 +5,22 @@ use PHPUnit\Framework\TestCase; /** - * @covers \PhoneNumberOneLine + * @covers \PhoneNumberShortcuts */ class RegionTest extends TestCase { public static function testRegion(): void { - $result = \PhoneNumberOneLine::getRegionCodeForNumber('+44 117 496 0123'); + $result = \PhoneNumberShortcuts::getRegionCodeForNumber('+44 117 496 0123'); self::assertSame($result, 'GB'); - $result = \PhoneNumberOneLine::getRegionCodeForNumber('+33 1 02 03 04 05'); + $result = \PhoneNumberShortcuts::getRegionCodeForNumber('+33 1 02 03 04 05'); self::assertSame($result, 'FR'); - $result = \PhoneNumberOneLine::getRegionCodeForNumber('+12135096995'); + $result = \PhoneNumberShortcuts::getRegionCodeForNumber('+12135096995'); self::assertSame($result, 'US'); - $result = \PhoneNumberOneLine::getRegionCodeForNumber('notanumber'); + $result = \PhoneNumberShortcuts::getRegionCodeForNumber('notanumber'); self::assertNull($result); } } diff --git a/tests/ValidTest.php b/tests/ValidTest.php index 6c459a1..30ca763 100644 --- a/tests/ValidTest.php +++ b/tests/ValidTest.php @@ -5,34 +5,34 @@ use PHPUnit\Framework\TestCase; /** - * @covers \PhoneNumberOneLine + * @covers \PhoneNumberShortcuts */ class ValidTest extends TestCase { public static function testValidWithRegion(): void { - $isValid = \PhoneNumberOneLine::isValid('06 07 08 09 10', 'FR'); + $isValid = \PhoneNumberShortcuts::isValid('06 07 08 09 10', 'FR'); self::assertTrue($isValid); - $isValid = \PhoneNumberOneLine::isValid('0607080910', 'FR'); + $isValid = \PhoneNumberShortcuts::isValid('0607080910', 'FR'); self::assertTrue($isValid); - $isValid = \PhoneNumberOneLine::isValid('+33 607080910', 'FR'); + $isValid = \PhoneNumberShortcuts::isValid('+33 607080910', 'FR'); self::assertTrue($isValid); - $isValid = \PhoneNumberOneLine::isValid('+1607080910', 'FR'); + $isValid = \PhoneNumberShortcuts::isValid('+1607080910', 'FR'); self::assertFalse($isValid); - $isValid = \PhoneNumberOneLine::isValid('+44123', 'FR'); + $isValid = \PhoneNumberShortcuts::isValid('+44123', 'FR'); self::assertFalse($isValid); } public static function testValidWithoutRegion(): void { - $isValid = \PhoneNumberOneLine::isValid('+33 607080910'); + $isValid = \PhoneNumberShortcuts::isValid('+33 607080910'); self::assertTrue($isValid); - $isValid = \PhoneNumberOneLine::isValid('notanumber'); + $isValid = \PhoneNumberShortcuts::isValid('notanumber'); self::assertFalse($isValid); } }