middleware([StartSession::class, HandleInertiaRequests::class])->uri; } public function test_adds_billing_information_to_shared_data_of_inertia_requests(): void { // Arrange $user = $this->createUserWithPermission(); $route = $this->createTestRoute(); $this->mock(BillingContract::class, function (MockInterface $mock) { $mock->shouldReceive('hasSubscription')->andReturn(false); $mock->shouldReceive('hasTrial')->andReturn(false); $mock->shouldReceive('isBlocked')->andReturn(false); }); Passport::actingAs($user->user); // Act $response = $this->get($route); // Assert $response->assertInertia(fn (Assert $page) => $page ->where('billing.has_subscription', false) ->where('billing.has_trial', false) ->where('billing.is_blocked', false) ); } }