Given a valid short number, determines whether it is carrier-specific (however, nothing is
implied about its validity). If it is important that the number is valid, then its validity
must first be checked using {@link isValidShortNumber} or
{@link #isValidShortNumberForRegion}.
public isCarrierSpecific ( |
||
$number | the valid short number to check | |
Результат | boolean | whether the short number is carrier-specific (assuming the input was a valid short number). |
/** * @dataProvider shortNumberRegionList */ public function testCarrierSpecificShortNumbers($regionCode) { // Test the carrier-specific tag. $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getCarrierSpecific(); if ($desc->hasExampleNumber()) { $exampleNumber = $desc->getExampleNumber(); $carrierSpecificNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode); if (!$this->shortNumberInfo->isPossibleShortNumberForRegion($carrierSpecificNumber, $regionCode) || !$this->shortNumberInfo->isCarrierSpecific($carrierSpecificNumber)) { $this->fail("Carrier-specific test failed for " . $regionCode); } } }