芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/pay/vendor/wixel/gump/tests/StaticSetErrorMessagesTest.php
'Field should be numeric', 'min_len' => 'Field length must be higher than what it is now' ]; $test = GUMP::set_error_messages($keysValues); $this->assertEquals($keysValues, self::getPrivateField($this->gump, 'validation_methods_errors')); } public function testItOverwritesAddValidatorErrorMessage() { GUMP::add_validator('custom', function($field, $input, array $params = []) { return $input[$field] === 'ok'; }, 'Error message'); GUMP::set_error_messages([ 'custom' =>'Field {field} should be numeric' ]); $result = GUMP::is_valid([ 'test' => 'notOk' ], [ 'test' => 'custom' ]); $this->assertEquals([ 'Field
Test
should be numeric' ], $result); } public function testItOverwritesLanguagefileErrorMessage() { GUMP::set_error_messages([ 'numeric' =>'Field {field} should be numeric !!!!!!!!!' ]); $result = GUMP::is_valid([ 'test' => 'notOk' ], [ 'test' => 'numeric' ]); $this->assertEquals([ 'Field
Test
should be numeric !!!!!!!!!' ], $result); } }