0

I have a weird issue that i don’t understand entirely. I’m running a test but a I’m getting a 419

$member = factory(User::class)->create([ 'type' => 'member' ]);
$title = "Random Title for Test.";
$case = factory(DentalCase::class)->raw(['title' => $title]);

$response = $this->actingAs($member)->post('/cases/create', $case);

$response->assertStatus(302);
$this->assertDatabaseHas('cases', ['title' => $title,]);

Error Response: Response status code [419] is not a successful status code.

dacastro4
  • 363
  • 6
  • 17

1 Answers1

0

The issue is with you local evironment being local and not testing, hence phpunit clashing with it. This line in your phpunit.xml

<env name="APP_ENV" value="testing" force="true" />

need to be set in .env.testing to 'testing'

A.L
  • 10,259
  • 10
  • 67
  • 98