Hi, i have a basic user model and i have the next validation:
array(‘verifyCode’, ‘captcha’, ‘allowEmpty’ => false, ‘on’ => ‘create,create_widget’),
when i run my unit test fails because i don’t know the captcha code
public function testCreate(){
//Create a new user
$newUser=new User('create');
$newUserMail = 'test@ticketea.com';
$password='pruebatest';
$passwordRepeat='pruebatest';
$password = $newUser->encrypt($password);
$this->assertNotEquals($password,$passwordRepeat);
$passwordRepeat=$password;
$newUser->setAttributes(
array(
'email' => $newUserMail,
'password' =>$password,
'password_repeat' => $passwordRepeat
)
);
$this->assertTrue($newUser->save());
}
How can i test this?
regards