Example #1
0
 /**
  * Test that phone() formats a number to a phone number.
  */
 public function testPhone()
 {
     $formats = array(7 => '###-####', 10 => '(###) ###-####', 11 => '# (###) ###-####');
     $this->assertEquals('666-1337', Format::phone(6661337, $formats));
     $this->assertEquals('(888) 666-1337', Format::phone('8886661337', $formats));
     $this->assertEquals('1 (888) 666-1337', Format::phone('+1 8886661337', $formats));
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public static function phone($value, $format = null)
 {
     return parent::phone($value, self::get('phone', $format));
 }