Commit 3ce0a546 authored by Dominic's avatar Dominic Committed by GitHub

Testing, use for HTTP tests

Directions on how to create HTTP tests and pass the required rule
parent 2478d98a
...@@ -132,6 +132,24 @@ NoCaptcha::shouldReceive('display') ...@@ -132,6 +132,24 @@ NoCaptcha::shouldReceive('display')
You can then test the remainder of your form as normal. You can then test the remainder of your form as normal.
When using HTTP tests you can add the `g-recaptcha-response` to the request body for the 'required' validation:
```php
// prevent validation error on captcha
NoCaptcha::shouldReceive('verifyResponse')
->once()
->andReturn(true);
// POST request, with request body including g-recaptcha-response
$response = $this->json('POST', '/register', [
'g-recaptcha-response' => '1',
'name' => 'John',
'email' => 'john@example.com',
'password' => '123456',
'password_confirmation' => '123456',
]);
```
## Without Laravel ## Without Laravel
Checkout example below: Checkout example below:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment