From 1bcb4446427185e8d893708def8e5102d59df89f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 6 Mar 2016 20:15:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/validateTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/thinkphp/library/think/validateTest.php b/tests/thinkphp/library/think/validateTest.php index 9b20aff4..cc117d2f 100644 --- a/tests/thinkphp/library/think/validateTest.php +++ b/tests/thinkphp/library/think/validateTest.php @@ -21,6 +21,16 @@ use think\Validate; class validateTest extends \PHPUnit_Framework_TestCase { + public function testRule() + { + Validate::rule('zip', '/^\d{6}$/'); + Validate::rule([ + 'currency' => '/^\d+(\.\d+)?$/', + 'number' => '/^\d+$/', + 'zip' => '/^\d{6}$/', + ]); + } + public function testCheck() { $data = [