Skip to content

Commit

Permalink
Handle lack of withPrecognition on earlier laravel versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Feb 1, 2024
1 parent 1fc8ac2 commit 3e7d8d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/Tags/User/LoginFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ public function it_fetches_form_data()
/** @test */
public function it_handles_precognitive_requests()
{
if (! method_exists($this, 'withPrecognition')) {
$this->markTestSkipped();
return;
}

$response = $this
->withPrecognition()
->post('/!/auth/login', [
Expand Down
5 changes: 5 additions & 0 deletions tests/Tags/User/PasswordFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ public function it_will_use_redirect_query_param_off_url()
/** @test */
public function it_handles_precognitive_requests()
{
if (! method_exists($this, 'withPrecognition')) {
$this->markTestSkipped();
return;
}

$this->actingAs(User::make()->password('mypassword')->save());

$response = $this
Expand Down
5 changes: 5 additions & 0 deletions tests/Tags/User/ProfileFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ private function useCustomBlueprint()
/** @test */
public function it_handles_precognitive_requests()
{
if (! method_exists($this, 'withPrecognition')) {
$this->markTestSkipped();
return;
}

$this->actingAs(User::make()->save());

$response = $this
Expand Down
5 changes: 5 additions & 0 deletions tests/Tags/User/RegisterFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ public function it_will_register_user_when_honeypot_is_not_present()
/** @test */
public function it_handles_precognitive_requests()
{
if (! method_exists($this, 'withPrecognition')) {
$this->markTestSkipped();
return;
}

$response = $this
->withPrecognition()
->post('/!/auth/register', [
Expand Down

0 comments on commit 3e7d8d9

Please sign in to comment.