biscolab/laravel-recaptcha

Feature testing with recaptcha

DWMcload opened this issue ยท 2 comments

Hello!

I couldn't find anything in your documentation about how to test recaptcha with phpunit. I have a complete set of feature tests for my authentication flow, and recently added recaptcha support with your package. And meanwhile I can disable recaptcha validation for testing via the CreatesApplication class, I'm not sure that is good solution and looking after a real way to test this.
Did I miss any guide or docs on this?
Would you mind adding it? Thanks!

I was able to do this in Laravel by mocking the ReCaptcha facade

ReCaptcha::shouldReceive('validate')
       ->once()
       ->andReturnTrue();

I was able to do this in Laravel by mocking the ReCaptcha facade

ReCaptcha::shouldReceive('validate')
       ->once()
       ->andReturnTrue();

Thank you, you saved my day ๐Ÿš€