skip to Main Content

A Laravel test that requires authentication does not pass in GitHub action

I have a simple test that checks that the dashboard is renderable for authenticated users. Here is the code: <?php namespace TestsFeature; use AppModelsUser; use TestsTestCase; class DashboardTest extends TestCase { public function test_dashboard_page_can_be_rendered() { $this->actingAs(User::factory()->create()); $response = $this->get('/dashboard'); $response->assertStatus(200);…

VIEW QUESTION

How to test json api? – Laravel

I have a test, which testing displaying deals. This test failed and show error Failed asserting that an array has the key 'user_id'.` I don't know reason why this error is public function a_test_display_deals() { $user = User::factory()->create(); $response =…

VIEW QUESTION
Back To Top
Search