Is Is the same value in confirm field
Definition
Return true if the confirm field is the exact same value as the field. Example if field is password, password_confirm should be equal to password field.
Usage
addRule("field -> confirm")
Tests
@Test
public final void testRuleConfirmOk() throws Exception {
FTest.getInstance()
.test("confirm success")
.field("pass", "123").field("pass_confirm", "123").rule("pass", "confirm", true)
.build().test()
.field("hello", "hello world").field("hello_confirm", "hello world").rule("hello", "confirm", true)
.build().test()
.field("hello", "helloxworld").field("hello_confirm", "helloxworld").rule("hello", "confirm", true)
.build();
}
@Test
public final void testRuleConfirmNotOk() throws Exception {
FTest.getInstance()
.test("confirm fail")
.field("pass", "123").field("pass_confirm", "1234").rule("pass", "confirm", false)
.build().test()
.field("hello", "hello world").rule("hello", "confirm", false)
.build().test()
.field("hel2lo", "helloxworld").field("hello_confirm", "helloxworld").rule("hello", "confirm", false)
.build();
}