Yii Framework Forum: How To Unittest Models With Captcha? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

How To Unittest Models With Captcha?

#1 User is offline   Xavier John 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 16-August 13
  • Location:Redmond, WA

Posted 29 August 2013 - 04:16 PM

I followed the recipe of 'Adding CAPTCHA' on page 126 and now the unittest fails with error.

PHP Fatal error: Call to a member function createAction() on a non-object in yii/framework/validators/CCaptchaValidator.php on line 66


From a design point of view, I prefer the Captcha logic to be in the controller than in the model. The model really has nothing to do with guest or logged in user.

Anyway, how do we unit test models with Captcha?
(or)
How do you avoid Captcha check during unittest?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users