withoutMiddleware(EnsurePlatformSession::class); [$owner, $organization, $east, $west] = $this->seedOrg(); $this->actingAs($owner) ->post(route('care.practitioners.store'), [ 'name' => 'Dr. Tele', 'specialty' => 'General Practice', ]) ->assertSessionHasErrors('branch_ids'); $this->actingAs($owner) ->post(route('care.practitioners.store'), [ 'name' => 'Dr. Tele', 'specialty' => 'General Practice', 'branch_ids' => [$east->id, $west->id], ]) ->assertRedirect(route('care.practitioners.index')); $practitioner = Practitioner::query()->where('name', 'Dr. Tele')->firstOrFail(); $this->assertEqualsCanonicalizing( [$east->id, $west->id], $practitioner->assignedBranchIds(), ); $this->assertSame($east->id, (int) $practitioner->branch_id); $this->actingAs($owner) ->get(route('care.practitioners.index')) ->assertOk() ->assertSee('East Legon Care') ->assertSee('West Hills Care') ->assertDontSee('All branches'); } public function test_practitioner_create_form_uses_specialty_dropdown(): void { $this->withoutMiddleware(EnsurePlatformSession::class); [$owner] = $this->seedOrg(); $this->actingAs($owner) ->get(route('care.practitioners.create')) ->assertOk() ->assertSee('name="specialty"', false) ->assertSee('