Extends
lithium\test\UnitSource
public function testValidatorWithFieldMapping() {
$subject = new Form(array(
'model' => __CLASS__,
'fields' => array('name' => 'user.name', 'password' => 'user.password'),
'validators' => array(
'password' => function ($form, $data) {
if ($form == $data) {
return true;
}
return false;
}
)
));
$request = (object) array('data' => array('name' => 'Foo', 'password' => 'bar'));
$this->assertTrue($subject->check($request));
}