public static function postal($check) { $pattern = '/^\\d{4}$/'; return (bool) preg_match($pattern, $check); }
/** * test the postal method of NoValidation * * @return void */ public function testPostal() { $this->assertTrue(NoValidation::postal('0123')); $this->assertFalse(NoValidation::postal('90210')); }