diff --git a/api/tests/Feature/Api/V1/Public/FormBuilder/IdentityMatchOnSubmitTest.php b/api/tests/Feature/Api/V1/Public/FormBuilder/IdentityMatchOnSubmitTest.php index 6dea16c5..33de6b51 100644 --- a/api/tests/Feature/Api/V1/Public/FormBuilder/IdentityMatchOnSubmitTest.php +++ b/api/tests/Feature/Api/V1/Public/FormBuilder/IdentityMatchOnSubmitTest.php @@ -139,7 +139,7 @@ final class IdentityMatchOnSubmitTest extends TestCase { $otherSchema = FormSchema::factory()->create([ 'organisation_id' => $this->org->id, - 'purpose' => FormPurpose::FEEDBACK, + 'purpose' => FormPurpose::INCIDENT_REPORT, ]); $submission = FormSubmission::factory()->create([ 'form_schema_id' => $otherSchema->id, diff --git a/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormDraftLifecycleTest.php b/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormDraftLifecycleTest.php index 2a79c831..8dfb3e55 100644 --- a/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormDraftLifecycleTest.php +++ b/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormDraftLifecycleTest.php @@ -31,7 +31,7 @@ final class PublicFormDraftLifecycleTest extends TestCase $org = Organisation::factory()->create(); $this->schema = FormSchema::factory()->create([ 'organisation_id' => $org->id, - 'purpose' => FormPurpose::PUBLIC_RSVP, + 'purpose' => FormPurpose::EVENT_REGISTRATION, 'is_published' => true, 'public_token' => (string) Str::ulid(), 'version' => 1, diff --git a/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormSubmissionResourceTest.php b/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormSubmissionResourceTest.php index 2b833ca4..372ceea6 100644 --- a/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormSubmissionResourceTest.php +++ b/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormSubmissionResourceTest.php @@ -28,7 +28,7 @@ final class PublicFormSubmissionResourceTest extends TestCase $org = Organisation::factory()->create(); $schema = FormSchema::factory()->create([ 'organisation_id' => $org->id, - 'purpose' => FormPurpose::PUBLIC_RSVP, + 'purpose' => FormPurpose::EVENT_REGISTRATION, 'is_published' => true, 'public_token' => (string) Str::ulid(), ]); diff --git a/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormValidationTest.php b/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormValidationTest.php index a0505a06..ce231468 100644 --- a/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormValidationTest.php +++ b/api/tests/Feature/Api/V1/Public/FormBuilder/PublicFormValidationTest.php @@ -31,7 +31,7 @@ final class PublicFormValidationTest extends TestCase $org = Organisation::factory()->create(); $this->schema = FormSchema::factory()->create([ 'organisation_id' => $org->id, - 'purpose' => FormPurpose::PUBLIC_RSVP, + 'purpose' => FormPurpose::EVENT_REGISTRATION, 'is_published' => true, 'public_token' => (string) Str::ulid(), ]); diff --git a/api/tests/Feature/FormBuilder/FormSchemaApiTest.php b/api/tests/Feature/FormBuilder/FormSchemaApiTest.php index cebcb846..62d5727d 100644 --- a/api/tests/Feature/FormBuilder/FormSchemaApiTest.php +++ b/api/tests/Feature/FormBuilder/FormSchemaApiTest.php @@ -79,7 +79,7 @@ final class FormSchemaApiTest extends TestCase $this->postJson("/api/v1/organisations/{$this->org->id}/forms/schemas", [ 'name' => 'Blocked', - 'purpose' => FormPurpose::FEEDBACK->value, + 'purpose' => FormPurpose::INCIDENT_REPORT->value, ])->assertStatus(403); } diff --git a/api/tests/Feature/FormBuilder/Listeners/TriggerPersonIdentityMatchOnFormSubmitTest.php b/api/tests/Feature/FormBuilder/Listeners/TriggerPersonIdentityMatchOnFormSubmitTest.php index 693fd280..236a0cd5 100644 --- a/api/tests/Feature/FormBuilder/Listeners/TriggerPersonIdentityMatchOnFormSubmitTest.php +++ b/api/tests/Feature/FormBuilder/Listeners/TriggerPersonIdentityMatchOnFormSubmitTest.php @@ -154,7 +154,7 @@ final class TriggerPersonIdentityMatchOnFormSubmitTest extends TestCase { $otherSchema = FormSchema::factory()->create([ 'organisation_id' => $this->org->id, - 'purpose' => FormPurpose::PUBLIC_COMPLAINT, + 'purpose' => FormPurpose::INCIDENT_REPORT, 'owner_type' => 'event', 'owner_id' => $this->event->id, ]); diff --git a/api/tests/Feature/FormBuilder/MorphMapAlignmentTest.php b/api/tests/Feature/FormBuilder/MorphMapAlignmentTest.php new file mode 100644 index 00000000..b5bbbbe8 --- /dev/null +++ b/api/tests/Feature/FormBuilder/MorphMapAlignmentTest.php @@ -0,0 +1,60 @@ +app->make(PurposeRegistry::class); + $morphMap = Relation::morphMap(); + + foreach ($registry->allSubjectTypes() as $alias) { + $this->assertArrayHasKey( + $alias, + $morphMap, + "Purpose subject_type '{$alias}' is declared in PurposeRegistry but " + ."missing from Relation::morphMap() in AppServiceProvider. " + ."Add it to the 'Domain subject types' block." + ); + } + } + + public function test_domain_subject_types_block_matches_registry_exactly(): void + { + $registry = $this->app->make(PurposeRegistry::class); + $registryAliases = $registry->allSubjectTypes(); + + // AppServiceProvider::PURPOSE_SUBJECT_FQCN is the single source of + // truth for which aliases the domain-subject-types block can emit. + // If the registry adds an alias not present in that lookup, boot() + // would throw — but we also assert it here for fast feedback. + $reflection = new \ReflectionClass(\App\Providers\AppServiceProvider::class); + $lookup = $reflection->getConstant('PURPOSE_SUBJECT_FQCN'); + $this->assertIsArray($lookup); + + foreach ($registryAliases as $alias) { + $this->assertArrayHasKey( + $alias, + $lookup, + "Purpose subject_type '{$alias}' has no FQCN in " + ."AppServiceProvider::PURPOSE_SUBJECT_FQCN. Register it there." + ); + } + } +} diff --git a/api/tests/Feature/FormBuilder/PublicFormApiTest.php b/api/tests/Feature/FormBuilder/PublicFormApiTest.php index 56d1484c..cd4e7481 100644 --- a/api/tests/Feature/FormBuilder/PublicFormApiTest.php +++ b/api/tests/Feature/FormBuilder/PublicFormApiTest.php @@ -30,7 +30,7 @@ final class PublicFormApiTest extends TestCase $this->org = Organisation::factory()->create(); $this->schema = FormSchema::factory()->create([ 'organisation_id' => $this->org->id, - 'purpose' => FormPurpose::PUBLIC_RSVP, + 'purpose' => FormPurpose::EVENT_REGISTRATION, 'is_published' => true, 'public_token' => (string) Str::ulid(), ]); diff --git a/api/tests/Feature/FormBuilder/Purposes/CustomPurposeEscapeRemovedTest.php b/api/tests/Feature/FormBuilder/Purposes/CustomPurposeEscapeRemovedTest.php new file mode 100644 index 00000000..3c815667 --- /dev/null +++ b/api/tests/Feature/FormBuilder/Purposes/CustomPurposeEscapeRemovedTest.php @@ -0,0 +1,87 @@ +assertFalse( + Schema::hasColumn('form_schemas', 'custom_purpose_slug'), + 'form_schemas.custom_purpose_slug must be dropped by migration 2026_04_24_100001.', + ); + } + + public function test_form_subjects_config_file_is_deleted(): void + { + $this->assertFileDoesNotExist( + base_path('config/form_subjects.php'), + 'config/form_subjects.php must be removed in WS-2 (Q6 consolidation).', + ); + } + + public function test_form_purpose_enum_has_no_custom_case(): void + { + foreach (FormPurpose::cases() as $case) { + $this->assertNotSame('custom', $case->value); + } + } + + public function test_store_endpoint_rejects_custom_purpose_value(): void + { + $this->seed(RoleSeeder::class); + $org = Organisation::factory()->create(); + $admin = User::factory()->create(); + $org->users()->attach($admin, ['role' => 'org_admin']); + $admin->assignRole('org_admin'); + setPermissionsTeamId($org->id); + + Sanctum::actingAs($admin); + + $this->postJson("/api/v1/organisations/{$org->id}/forms/schemas", [ + 'name' => 'X', + 'purpose' => 'custom', + ])->assertStatus(422); + } + + public function test_schema_response_omits_custom_purpose_slug(): void + { + $this->seed(RoleSeeder::class); + $org = Organisation::factory()->create(); + $admin = User::factory()->create(); + $org->users()->attach($admin, ['role' => 'org_admin']); + $admin->assignRole('org_admin'); + setPermissionsTeamId($org->id); + + Sanctum::actingAs($admin); + + $schema = FormSchema::factory()->create([ + 'organisation_id' => $org->id, + 'purpose' => FormPurpose::INCIDENT_REPORT, + ]); + + $response = $this->getJson("/api/v1/organisations/{$org->id}/forms/schemas/{$schema->id}") + ->assertOk(); + + $this->assertArrayNotHasKey('custom_purpose_slug', $response->json('data')); + } +} diff --git a/api/tests/Feature/FormBuilder/Purposes/PurposeRegistryTest.php b/api/tests/Feature/FormBuilder/Purposes/PurposeRegistryTest.php new file mode 100644 index 00000000..f12eaa77 --- /dev/null +++ b/api/tests/Feature/FormBuilder/Purposes/PurposeRegistryTest.php @@ -0,0 +1,113 @@ +app->make(PurposeRegistry::class); + } + + public function test_loads_all_seven_purposes_from_config(): void + { + $registry = $this->registry(); + $all = $registry->all(); + + $this->assertCount(7, $all); + $this->assertSame( + [ + 'event_registration', + 'artist_advance', + 'supplier_intake', + 'post_event_evaluation', + 'incident_report', + 'signature_contract', + 'user_profile', + ], + array_keys($all), + ); + } + + public function test_event_registration_definition_is_complete(): void + { + $def = $this->registry()->get('event_registration'); + + $this->assertSame('event_registration', $def->slug); + $this->assertSame('Aanmelding vrijwilligers/crew', $def->label); + $this->assertSame('person', $def->subjectType); + $this->assertSame(FormSubmissionMode::SINGLE, $def->defaultSubmissionMode); + $this->assertTrue($def->allowsPublicAccess); + $this->assertSame( + ['person.email', 'person.first_name', 'person.last_name'], + $def->requiredBindings, + ); + } + + public function test_artist_advance_uses_draft_single(): void + { + $def = $this->registry()->get('artist_advance'); + + $this->assertSame('artist', $def->subjectType); + $this->assertSame(FormSubmissionMode::DRAFT_SINGLE, $def->defaultSubmissionMode); + $this->assertFalse($def->allowsPublicAccess); + $this->assertSame([], $def->requiredBindings); + } + + public function test_supplier_intake_requires_company_name(): void + { + $def = $this->registry()->get('supplier_intake'); + + $this->assertSame('company', $def->subjectType); + $this->assertSame(FormSubmissionMode::SINGLE, $def->defaultSubmissionMode); + $this->assertFalse($def->allowsPublicAccess); + $this->assertSame(['company.name'], $def->requiredBindings); + } + + public function test_get_throws_on_unknown_slug(): void + { + $this->expectException(PurposeNotFoundException::class); + + $this->registry()->get('does_not_exist'); + } + + public function test_has_returns_false_for_unknown_slug(): void + { + $this->assertFalse($this->registry()->has('does_not_exist')); + $this->assertTrue($this->registry()->has('event_registration')); + } + + public function test_all_subject_types_returns_four_sorted_aliases(): void + { + $this->assertSame( + ['artist', 'company', 'person', 'user'], + $this->registry()->allSubjectTypes(), + ); + } + + public function test_public_accessible_slugs_is_only_event_registration(): void + { + $this->assertSame( + ['event_registration'], + $this->registry()->publicAccessibleSlugs(), + ); + } + + public function test_result_is_memoised_on_instance(): void + { + $registry = $this->registry(); + $first = $registry->all(); + $second = $registry->all(); + + $this->assertSame($first, $second); + // Same PurposeDefinition instance per slug across calls. + $this->assertSame($first['event_registration'], $second['event_registration']); + } +} diff --git a/api/tests/Feature/FormBuilder/Purposes/PurposeSchemaLifecycleTest.php b/api/tests/Feature/FormBuilder/Purposes/PurposeSchemaLifecycleTest.php new file mode 100644 index 00000000..1224cc59 --- /dev/null +++ b/api/tests/Feature/FormBuilder/Purposes/PurposeSchemaLifecycleTest.php @@ -0,0 +1,159 @@ +seed(RoleSeeder::class); + + $this->org = Organisation::factory()->create(); + $this->actor = User::factory()->create(); + $this->org->users()->attach($this->actor, ['role' => 'org_admin']); + $this->actor->assignRole('org_admin'); + setPermissionsTeamId($this->org->id); + + $this->service = $this->app->make(FormSchemaService::class); + } + + /** @return iterable */ + public static function purposeProvider(): iterable + { + foreach (FormPurpose::cases() as $case) { + yield $case->value => [$case]; + } + } + + /** @dataProvider purposeProvider */ + public function test_create_and_publish_succeeds_for_purpose(FormPurpose $purpose): void + { + $schema = $this->service->create( + $this->org, + [ + 'name' => 'Schema '.$purpose->value, + 'purpose' => $purpose->value, + ], + $this->actor, + ); + $this->seedRequiredBindings($schema, $purpose); + + $published = $this->service->publish($schema->fresh('fields'), $this->actor); + + $this->assertTrue((bool) $published->is_published); + $this->assertSame($purpose->value, $published->purpose->value ?? $published->purpose); + } + + public function test_event_registration_without_required_bindings_fails_publish(): void + { + $schema = $this->service->create( + $this->org, + ['name' => 'ER', 'purpose' => FormPurpose::EVENT_REGISTRATION->value], + $this->actor, + ); + + try { + $this->service->publish($schema->fresh('fields'), $this->actor); + $this->fail('Expected PurposeRequirementsNotMetException'); + } catch (PurposeRequirementsNotMetException $e) { + $this->assertSame('event_registration', $e->purposeSlug); + $this->assertSame( + ['person.email', 'person.first_name', 'person.last_name'], + $e->missingBindings, + ); + } + } + + public function test_supplier_intake_without_company_name_binding_fails_publish(): void + { + $schema = $this->service->create( + $this->org, + ['name' => 'SI', 'purpose' => FormPurpose::SUPPLIER_INTAKE->value], + $this->actor, + ); + + try { + $this->service->publish($schema->fresh('fields'), $this->actor); + $this->fail('Expected PurposeRequirementsNotMetException'); + } catch (PurposeRequirementsNotMetException $e) { + $this->assertSame('supplier_intake', $e->purposeSlug); + $this->assertSame(['company.name'], $e->missingBindings); + } + } + + public function test_event_registration_partial_bindings_reports_only_missing(): void + { + $schema = $this->service->create( + $this->org, + ['name' => 'ER-partial', 'purpose' => FormPurpose::EVENT_REGISTRATION->value], + $this->actor, + ); + $this->addBindingField($schema, 'person', 'email', 'email'); + + try { + $this->service->publish($schema->fresh('fields'), $this->actor); + $this->fail('Expected PurposeRequirementsNotMetException'); + } catch (PurposeRequirementsNotMetException $e) { + $this->assertSame( + ['person.first_name', 'person.last_name'], + $e->missingBindings, + ); + } + } + + private function seedRequiredBindings(FormSchema $schema, FormPurpose $purpose): void + { + match ($purpose) { + FormPurpose::EVENT_REGISTRATION => [ + $this->addBindingField($schema, 'person', 'email', 'email'), + $this->addBindingField($schema, 'person', 'first_name', 'first_name'), + $this->addBindingField($schema, 'person', 'last_name', 'last_name'), + ], + FormPurpose::SUPPLIER_INTAKE => [ + $this->addBindingField($schema, 'company', 'name', 'company_name'), + ], + default => null, + }; + } + + private function addBindingField(FormSchema $schema, string $entity, string $column, string $slug): FormField + { + return FormField::factory()->create([ + 'form_schema_id' => $schema->id, + 'field_type' => FormFieldType::TEXT, + 'slug' => $slug, + 'label' => ucfirst($slug), + 'binding' => ['mode' => 'entity_owned', 'entity' => $entity, 'column' => $column], + ]); + } +} diff --git a/api/tests/Feature/FormBuilder/Purposes/SubjectTypeRegistryConsolidationTest.php b/api/tests/Feature/FormBuilder/Purposes/SubjectTypeRegistryConsolidationTest.php new file mode 100644 index 00000000..fd6b069f --- /dev/null +++ b/api/tests/Feature/FormBuilder/Purposes/SubjectTypeRegistryConsolidationTest.php @@ -0,0 +1,91 @@ +seed(RoleSeeder::class); + + $this->org = Organisation::factory()->create(); + $this->admin = User::factory()->create(); + $this->org->users()->attach($this->admin, ['role' => 'org_admin']); + $this->admin->assignRole('org_admin'); + setPermissionsTeamId($this->org->id); + + $this->schema = FormSchema::factory()->create([ + 'organisation_id' => $this->org->id, + 'purpose' => FormPurpose::INCIDENT_REPORT, + 'is_published' => true, + ]); + } + + public function test_accepts_registry_subject_types(): void + { + Sanctum::actingAs($this->admin); + $event = Event::factory()->create(['organisation_id' => $this->org->id]); + $person = Person::factory()->create(['event_id' => $event->id]); + + $this->postJson( + "/api/v1/organisations/{$this->org->id}/forms/schemas/{$this->schema->id}/submissions", + [ + 'subject_type' => 'person', + 'subject_id' => $person->id, + ], + )->assertCreated(); + } + + public function test_rejects_subject_type_not_in_registry(): void + { + Sanctum::actingAs($this->admin); + + $this->postJson( + "/api/v1/organisations/{$this->org->id}/forms/schemas/{$this->schema->id}/submissions", + [ + 'subject_type' => 'event', + 'subject_id' => (string) \Illuminate\Support\Str::ulid(), + ], + )->assertStatus(422); + } + + public function test_rejects_subject_type_that_never_existed(): void + { + Sanctum::actingAs($this->admin); + + $this->postJson( + "/api/v1/organisations/{$this->org->id}/forms/schemas/{$this->schema->id}/submissions", + [ + 'subject_type' => 'unicorn', + 'subject_id' => (string) \Illuminate\Support\Str::ulid(), + ], + )->assertStatus(422); + } +} diff --git a/api/tests/Unit/Enums/FormBuilder/FormPurposeTest.php b/api/tests/Unit/Enums/FormBuilder/FormPurposeTest.php index 438ab96f..8674a2ed 100644 --- a/api/tests/Unit/Enums/FormBuilder/FormPurposeTest.php +++ b/api/tests/Unit/Enums/FormBuilder/FormPurposeTest.php @@ -6,96 +6,59 @@ namespace Tests\Unit\Enums\FormBuilder; use App\Enums\FormBuilder\FormPurpose; use App\Enums\FormBuilder\FormSubmissionMode; -use PHPUnit\Framework\TestCase; +use Tests\TestCase; -class FormPurposeTest extends TestCase +final class FormPurposeTest extends TestCase { - public function test_has_22_cases(): void + public function test_has_seven_cases(): void { - $this->assertCount(22, FormPurpose::cases()); + $this->assertCount(7, FormPurpose::cases()); } - public function test_values_contains_expected_strings(): void + public function test_values_match_v1_vocabulary(): void { - $values = FormPurpose::values(); - $expected = [ - 'event_registration', 'user_profile', 'artist_profile', 'company_profile', - 'artist_advance', 'supplier_intake', 'incident_report', 'feedback', - 'post_event_evaluation', 'signature_contract', 'signature_code_of_conduct', - 'signature_receipt', 'absence_report', 'check_out_inventory', - 'public_complaint', 'public_press_request', 'public_rsvp', - 'onboarding_wizard', 'event_setup_wizard', 'company_custom', - 'artist_custom', 'custom', - ]; - foreach ($expected as $v) { - $this->assertContains($v, $values); - } + $this->assertSame( + [ + 'event_registration', + 'artist_advance', + 'supplier_intake', + 'post_event_evaluation', + 'incident_report', + 'signature_contract', + 'user_profile', + ], + FormPurpose::values(), + ); } - public function test_default_subject_type_for_person_purposes(): void + public function test_default_submission_mode_delegates_to_registry(): void + { + $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::EVENT_REGISTRATION->defaultSubmissionMode()); + $this->assertSame(FormSubmissionMode::DRAFT_SINGLE, FormPurpose::ARTIST_ADVANCE->defaultSubmissionMode()); + $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::SUPPLIER_INTAKE->defaultSubmissionMode()); + $this->assertSame(FormSubmissionMode::MULTIPLE, FormPurpose::INCIDENT_REPORT->defaultSubmissionMode()); + $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::USER_PROFILE->defaultSubmissionMode()); + } + + public function test_default_subject_type_delegates_to_registry(): void { $this->assertSame('person', FormPurpose::EVENT_REGISTRATION->defaultSubjectType()); - $this->assertSame('person', FormPurpose::POST_EVENT_EVALUATION->defaultSubjectType()); - $this->assertSame('person', FormPurpose::SIGNATURE_RECEIPT->defaultSubjectType()); - $this->assertSame('person', FormPurpose::ABSENCE_REPORT->defaultSubjectType()); - $this->assertSame('person', FormPurpose::CHECK_OUT_INVENTORY->defaultSubjectType()); - } - - public function test_default_subject_type_for_entity_purposes(): void - { - $this->assertSame('user', FormPurpose::USER_PROFILE->defaultSubjectType()); - $this->assertSame('artist', FormPurpose::ARTIST_PROFILE->defaultSubjectType()); - $this->assertSame('company', FormPurpose::COMPANY_PROFILE->defaultSubjectType()); $this->assertSame('artist', FormPurpose::ARTIST_ADVANCE->defaultSubjectType()); $this->assertSame('company', FormPurpose::SUPPLIER_INTAKE->defaultSubjectType()); - $this->assertSame('organisation', FormPurpose::ONBOARDING_WIZARD->defaultSubjectType()); - $this->assertSame('event', FormPurpose::EVENT_SETUP_WIZARD->defaultSubjectType()); + $this->assertSame('person', FormPurpose::POST_EVENT_EVALUATION->defaultSubjectType()); + $this->assertSame('person', FormPurpose::INCIDENT_REPORT->defaultSubjectType()); + $this->assertSame('user', FormPurpose::SIGNATURE_CONTRACT->defaultSubjectType()); + $this->assertSame('user', FormPurpose::USER_PROFILE->defaultSubjectType()); } - public function test_default_subject_type_is_null_for_public_and_custom(): void + public function test_only_event_registration_allows_public_access(): void { - $this->assertNull(FormPurpose::PUBLIC_COMPLAINT->defaultSubjectType()); - $this->assertNull(FormPurpose::PUBLIC_PRESS_REQUEST->defaultSubjectType()); - $this->assertNull(FormPurpose::PUBLIC_RSVP->defaultSubjectType()); - $this->assertNull(FormPurpose::CUSTOM->defaultSubjectType()); - } - - public function test_default_submission_mode_draft_single(): void - { - $this->assertSame(FormSubmissionMode::DRAFT_SINGLE, FormPurpose::EVENT_REGISTRATION->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::DRAFT_SINGLE, FormPurpose::ARTIST_ADVANCE->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::DRAFT_SINGLE, FormPurpose::SUPPLIER_INTAKE->defaultSubmissionMode()); - } - - public function test_default_submission_mode_multiple(): void - { - $this->assertSame(FormSubmissionMode::MULTIPLE, FormPurpose::INCIDENT_REPORT->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::MULTIPLE, FormPurpose::FEEDBACK->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::MULTIPLE, FormPurpose::PUBLIC_COMPLAINT->defaultSubmissionMode()); - } - - public function test_default_submission_mode_single(): void - { - $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::USER_PROFILE->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::ARTIST_PROFILE->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::ONBOARDING_WIZARD->defaultSubmissionMode()); - $this->assertSame(FormSubmissionMode::SINGLE, FormPurpose::CUSTOM->defaultSubmissionMode()); - } - - public function test_allows_public_access(): void - { - $this->assertTrue(FormPurpose::PUBLIC_COMPLAINT->allowsPublicAccess()); - $this->assertTrue(FormPurpose::PUBLIC_PRESS_REQUEST->allowsPublicAccess()); - $this->assertTrue(FormPurpose::PUBLIC_RSVP->allowsPublicAccess()); - $this->assertTrue(FormPurpose::ARTIST_ADVANCE->allowsPublicAccess()); - $this->assertTrue(FormPurpose::SUPPLIER_INTAKE->allowsPublicAccess()); - } - - public function test_disallows_public_access(): void - { - $this->assertFalse(FormPurpose::EVENT_REGISTRATION->allowsPublicAccess()); - $this->assertFalse(FormPurpose::USER_PROFILE->allowsPublicAccess()); + $this->assertTrue(FormPurpose::EVENT_REGISTRATION->allowsPublicAccess()); + $this->assertFalse(FormPurpose::ARTIST_ADVANCE->allowsPublicAccess()); + $this->assertFalse(FormPurpose::SUPPLIER_INTAKE->allowsPublicAccess()); + $this->assertFalse(FormPurpose::POST_EVENT_EVALUATION->allowsPublicAccess()); $this->assertFalse(FormPurpose::INCIDENT_REPORT->allowsPublicAccess()); - $this->assertFalse(FormPurpose::CUSTOM->allowsPublicAccess()); + $this->assertFalse(FormPurpose::SIGNATURE_CONTRACT->allowsPublicAccess()); + $this->assertFalse(FormPurpose::USER_PROFILE->allowsPublicAccess()); } }