Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from DarkGhostHunter/master
Browse files Browse the repository at this point in the history
Fixed test for variable reCAPTCHA token, again.
  • Loading branch information
DarkGhostHunter authored Jun 13, 2019
2 parents 3bf4823 + 1e7ff93 commit 1b3a0a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Http/Middleware/CheckRecaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function isPostMethod(Request $request)
protected function hasValidRequest(Request $request)
{
$isValid = !$this->validator->make($request->only('_recaptcha'), [
'_recaptcha' => 'required|string|between:300,400',
'_recaptcha' => 'required|string',
])->fails();

return throw_unless($isValid, InvalidRecaptchaException::class, $request->only('_recaptcha'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Middleware/CheckRecaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testFailsOnNonPostMethod()

public function testFailsInvalidToken()
{
$response = $this->post('test-post', [ '_recaptcha' => Str::random(401)]);
$response = $this->post('test-post', [ '_recaptcha' => ['not.string']]);

$response->assertStatus(500);
$this->assertInstanceOf(InvalidRecaptchaException::class, $response->exception);
Expand Down

0 comments on commit 1b3a0a2

Please sign in to comment.