thinhbuzz / laravel-google-captcha

Google captcha for Laravel 5, Laravel 6, Laravel 7, Laravel 8, Laravel 9 and Laravel 10, support multiple captcha on page
MIT License
200 stars 32 forks source link

Update test documentation for multiple captchas on a single page #10

Closed gdejong closed 7 years ago

gdejong commented 7 years ago

Hi there,

Let me start off by saying that I am very thankful for your recent update to this library to support multiple captchas on a single page!

I found however that I needed to update my integration tests as well with those new changes, and was wondering if this could be updated in the docs?

I have added three calls to my tests, could you tell me if this is the correct way to go? The first 2 shouldReceive calls are already documented by you. This is for testing a page that is using multiple captchas.

// prevent validation error on captcha
        CaptchaFacade::shouldReceive('verify')
            ->andReturn(true);

// provide hidden input for your 'required' validation
        CaptchaFacade::shouldReceive('display')
            ->andReturn('<input type="hidden" name="g-recaptcha-response" value="1" />');

CaptchaFacade::shouldReceive("displayJs");
CaptchaFacade::shouldReceive("displayMultiple");
CaptchaFacade::shouldReceive("multiple");

Cheers

thinhbuzz commented 7 years ago

you can create pull request for it ;)

gdejong commented 7 years ago

Sure, no problem :) Just wanted to verify this is the way to go.

gdejong commented 7 years ago

See #11

Cheers