From 27f3127fbb0d2b43b0bc6a6daf781ca32311a24c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 21 Mar 2016 13:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 21 +------------------ tests/thinkphp/library/think/validateTest.php | 13 ------------ 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/library/think/Validate.php b/library/think/Validate.php index d96ee276..486e16d0 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -89,13 +89,11 @@ class Validate * @access public * @param array $rules 验证规则 * @param array $message 验证提示信息 - * @param array $config 验证参数 */ - public function __construct(array $rules = [], $message = [], $config = []) + public function __construct(array $rules = [], $message = []) { $this->rule = array_merge($this->rule, $rules); $this->message = array_merge($this->message, $message); - $this->config = array_merge($this->config, $config); } /** @@ -182,23 +180,6 @@ class Validate return $this; } - /** - * 传入验证参数 - * @access public - * @param string|array $name 参数名或者数组 - * @param mixed $value 参数值 - * @return Validate - */ - public function config($name, $value = null) - { - if (is_array($name)) { - $this->config = array_merge($this->config, $name); - } else { - $this->config[$name] = $value; - } - return $this; - } - /** * 设置验证场景 * @access public diff --git a/tests/thinkphp/library/think/validateTest.php b/tests/thinkphp/library/think/validateTest.php index 88398e7f..3f4c110d 100644 --- a/tests/thinkphp/library/think/validateTest.php +++ b/tests/thinkphp/library/think/validateTest.php @@ -104,19 +104,6 @@ class validateTest extends \PHPUnit_Framework_TestCase ]); } - public function testConfig() - { - $validate = new Validate(); - $validate->config('value_validate', ['name', 'age', 'email']); - $validate->config([ - 'value_validate' => ['name', 'age', 'email'], - 'exists_validate' => ['zip'], - 'scene' => [ - 'edit' => ['name', 'age', 'email'], - ], - ]); - } - public function testMake() { $rule = [