/** * {@inheritdoc} */ public static function phone($input, $format = null) { return parent::phone($input, self::get('phone', $format)); }
/** * 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')); }