Пример #1
0
 /**
  * {@inheritdoc}
  */
 public static function phone($input, $format = null)
 {
     return parent::phone($input, self::get('phone', $format));
 }
Пример #2
0
 /**
  * Test that phone() validates against the locales phone rule.
  */
 public function testPhone()
 {
     $this->assertTrue(Validate::phone('666-1337'));
     $this->assertTrue(Validate::phone('(888)666-1337'));
     $this->assertTrue(Validate::phone('(888) 666-1337'));
     $this->assertTrue(Validate::phone('1 (888) 666-1337'));
     $this->assertTrue(Validate::phone('+1 (888) 666-1337'));
     $this->assertFalse(Validate::phone('666.1337'));
     $this->assertFalse(Validate::phone('888-666.1337'));
     $this->assertFalse(Validate::phone('1 888.666.1337'));
     $this->assertFalse(Validate::phone('666-ABMS'));
 }