Extends
lithium\test\UnitSource
public function testGenericValidator() {
$self = $this;
$subject = new Form(array(
'model' => __CLASS__,
'query' => 'validatorTest',
'validators' => array(
function($data, $user) use ($self) {
return true;
}
)
));
$request = (object) array('data' => array(
'username' => 'Bob', 'password' => 's3cure', 'group' => 'editors'
));
$result = $subject->check($request);
$this->assertEqual(array_keys($request->data), array_keys($result));
}