BeforeValidate and test controller