From af87400178ab35cfa79da8c58e2b909e2fe48900 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Sun, 1 Dec 2024 14:57:00 -0400 Subject: [PATCH] Revert "test: fix deprecation errors (#2351)" e04e0d56cdc7cad5af58718cda0799afd18885cd --- .../Datasets/AddOrganizationValidationErrors.php | 4 ++-- tests/Datasets/BrowseEngagementsFormat.php | 2 +- .../DestroyIndividualRequestValidationErrors.php | 4 ++-- ...estroyOrganizationRequestValidationErrors.php | 4 ++-- .../DestroyProjectRequestValidationErrors.php | 4 ++-- ...ulatedOrganizationRequestValidationErrors.php | 4 ++-- .../InviteParticipantValidationErrors.php | 4 ++-- ...eOrganizationRolesRequestValidationErrors.php | 4 ++-- ...oreAccessNeedsPermissionsValidationErrors.php | 4 ++-- ...reEngagementFormatRequestValidationErrors.php | 4 ++-- ...ngagementLanguagesRequestValidationErrors.php | 4 ++-- ...agementRecruitmentRequestValidationErrors.php | 4 ++-- .../StoreEngagementRequestValidationErrors.php | 4 ++-- ...anizationLanguagesRequestValidationErrors.php | 4 ++-- .../StoreOrganizationRequestValidationErrors.php | 4 ++-- ...reOrganizationTypeRequestValidationErrors.php | 4 ++-- ...toreProjectContextRequestValidationErrors.php | 4 ++-- ...reProjectLanguagesRequestValidationErrors.php | 4 ++-- .../StoreProjectRequestValidationErrors.php | 4 ++-- ...anizationLanguagesRequestValidationErrors.php | 4 ++-- ...ulatedOrganizationRequestValidationErrors.php | 4 ++-- ...edOrganizationTypeRequestValidationErrors.php | 4 ++-- ...ngagementLanguagesRequestValidationErrors.php | 4 ++-- .../UpdateEngagementRequestValidationErrors.php | 4 ++-- ...ltationPreferencesRequestValidationErrors.php | 4 ++-- ...dualConstituenciesRequestValidationErrors.php | 4 ++-- ...ividualExperiencesRequestValidationErrors.php | 4 ++-- ...ndividualInterestsRequestValidationErrors.php | 4 ++-- .../UpdateIndividualRequestValidationErrors.php | 4 ++-- ...tionConstituenciesRequestValidationErrors.php | 4 ++-- ...ContactInformationRequestValidationErrors.php | 4 ++-- ...anizationInterestsRequestValidationErrors.php | 4 ++-- ...UpdateOrganizationRequestValidationErrors.php | 4 ++-- .../UpdateProjectRequestValidationErrors.php | 4 ++-- .../UpdateProjectTeamRequestValidationErrors.php | 4 ++-- ...ulatedOrganizationRequestValidationErrors.php | 4 ++-- tests/Feature/EngagementTest.php | 16 ++++++++-------- tests/Feature/PageTest.php | 10 +++++----- tests/Feature/ProjectTest.php | 6 +++--- tests/Unit/SafeNL2BRHelperTest.php | 4 ++-- 40 files changed, 89 insertions(+), 89 deletions(-) diff --git a/tests/Datasets/AddOrganizationValidationErrors.php b/tests/Datasets/AddOrganizationValidationErrors.php index ce9211d80..5ff576143 100644 --- a/tests/Datasets/AddOrganizationValidationErrors.php +++ b/tests/Datasets/AddOrganizationValidationErrors.php @@ -4,7 +4,7 @@ use App\Models\Organization; dataset('addOrganizationValidationErrors', function () { - return array_map('array_values', [ + return [ 'Organization id is missing' => [ 'state' => ['organization_id' => null], 'errors' => fn () => ['organization_id' => __('validation.required', ['attribute' => __('organization.singular_name')])], @@ -20,5 +20,5 @@ ])->id], 'errors' => fn () => ['organization_id' => __('The organization you have added does not participate in engagements.')], ], - ]); + ]; }); diff --git a/tests/Datasets/BrowseEngagementsFormat.php b/tests/Datasets/BrowseEngagementsFormat.php index 196e0f1ef..437103517 100644 --- a/tests/Datasets/BrowseEngagementsFormat.php +++ b/tests/Datasets/BrowseEngagementsFormat.php @@ -33,5 +33,5 @@ ]; } - return array_map('array_values', $testCases); + return $testCases; }); diff --git a/tests/Datasets/DestroyIndividualRequestValidationErrors.php b/tests/Datasets/DestroyIndividualRequestValidationErrors.php index 0fd204bee..1d1970cf5 100644 --- a/tests/Datasets/DestroyIndividualRequestValidationErrors.php +++ b/tests/Datasets/DestroyIndividualRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['current_password' => null], 'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])], @@ -14,5 +14,5 @@ 'state' => ['current_password' => 'fake_password'], 'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')], ], - ]); + ]; }); diff --git a/tests/Datasets/DestroyOrganizationRequestValidationErrors.php b/tests/Datasets/DestroyOrganizationRequestValidationErrors.php index 175fa58ce..98200e70e 100644 --- a/tests/Datasets/DestroyOrganizationRequestValidationErrors.php +++ b/tests/Datasets/DestroyOrganizationRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['current_password' => null], 'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])], @@ -14,5 +14,5 @@ 'state' => ['current_password' => 'fake_password'], 'errors' => fn () => ['current_password' => __('validation.current_password', ['attribute' => __('current password')])], ], - ]); + ]; }); diff --git a/tests/Datasets/DestroyProjectRequestValidationErrors.php b/tests/Datasets/DestroyProjectRequestValidationErrors.php index 72d0c90fd..2d450c8d4 100644 --- a/tests/Datasets/DestroyProjectRequestValidationErrors.php +++ b/tests/Datasets/DestroyProjectRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => [], 'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])], @@ -14,5 +14,5 @@ 'state' => ['current_password' => 'WrongPassword'], 'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')], ], - ]); + ]; }); diff --git a/tests/Datasets/DestroyRegulatedOrganizationRequestValidationErrors.php b/tests/Datasets/DestroyRegulatedOrganizationRequestValidationErrors.php index 1c64db0b3..2b40bf2e1 100644 --- a/tests/Datasets/DestroyRegulatedOrganizationRequestValidationErrors.php +++ b/tests/Datasets/DestroyRegulatedOrganizationRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['current_password' => null], 'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])], @@ -14,5 +14,5 @@ 'state' => ['current_password' => 'fake_password'], 'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')], ], - ]); + ]; }); diff --git a/tests/Datasets/InviteParticipantValidationErrors.php b/tests/Datasets/InviteParticipantValidationErrors.php index 1ab86be7a..022b3d9e2 100644 --- a/tests/Datasets/InviteParticipantValidationErrors.php +++ b/tests/Datasets/InviteParticipantValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['email' => null], 'errors' => fn () => ['email' => __('You must enter an email address.')], @@ -22,5 +22,5 @@ 'state' => ['email' => 'not-individual@example.com'], 'errors' => fn () => ['email' => __('The person with the email address you provided is not a consultation participant.')], ], - ]); + ]; }); diff --git a/tests/Datasets/SaveOrganizationRolesRequestValidationErrors.php b/tests/Datasets/SaveOrganizationRolesRequestValidationErrors.php index a6a2b53f7..8eb43e333 100644 --- a/tests/Datasets/SaveOrganizationRolesRequestValidationErrors.php +++ b/tests/Datasets/SaveOrganizationRolesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['roles' => null], 'errors' => fn () => ['roles' => __('You must select a role for your organization.')], @@ -14,5 +14,5 @@ 'state' => ['roles' => ['other']], 'errors' => fn () => ['roles.0' => __('validation.exists', ['attribute' => __('roles')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreAccessNeedsPermissionsValidationErrors.php b/tests/Datasets/StoreAccessNeedsPermissionsValidationErrors.php index 0ec03d119..a9403180f 100644 --- a/tests/Datasets/StoreAccessNeedsPermissionsValidationErrors.php +++ b/tests/Datasets/StoreAccessNeedsPermissionsValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => [], 'errors' => fn () => ['share_access_needs' => __('validation.required', ['attribute' => __('share access needs')])], @@ -10,5 +10,5 @@ 'state' => ['share_access_needs' => 123], 'errors' => fn () => ['share_access_needs' => __('validation.boolean', ['attribute' => __('share access needs')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreEngagementFormatRequestValidationErrors.php b/tests/Datasets/StoreEngagementFormatRequestValidationErrors.php index aa78f7c29..846403234 100644 --- a/tests/Datasets/StoreEngagementFormatRequestValidationErrors.php +++ b/tests/Datasets/StoreEngagementFormatRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['format' => null], 'errors' => fn () => ['format' => __('validation.required', ['attribute' => __('engagement format')])], @@ -10,5 +10,5 @@ 'state' => ['format' => ['xyz']], 'errors' => fn () => ['format' => __('validation.exists', ['attribute' => __('engagement format')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreEngagementLanguagesRequestValidationErrors.php b/tests/Datasets/StoreEngagementLanguagesRequestValidationErrors.php index 1a12ae7e9..d472a3a56 100644 --- a/tests/Datasets/StoreEngagementLanguagesRequestValidationErrors.php +++ b/tests/Datasets/StoreEngagementLanguagesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['languages' => null], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])], @@ -18,5 +18,5 @@ 'state' => ['languages' => ['xyz']], 'errors' => fn () => ['languages.0' => __('validation.exists', ['attribute' => __('languages')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreEngagementRecruitmentRequestValidationErrors.php b/tests/Datasets/StoreEngagementRecruitmentRequestValidationErrors.php index 26bcf540a..c9f604b77 100644 --- a/tests/Datasets/StoreEngagementRecruitmentRequestValidationErrors.php +++ b/tests/Datasets/StoreEngagementRecruitmentRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['recruitment' => null], 'errors' => fn () => ['recruitment' => __('validation.required', ['attribute' => __('recruitment method')])], @@ -10,5 +10,5 @@ 'state' => ['recruitment' => ['xyz']], 'errors' => fn () => ['recruitment' => __('validation.exists', ['attribute' => __('recruitment method')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreEngagementRequestValidationErrors.php b/tests/Datasets/StoreEngagementRequestValidationErrors.php index 0e2aa2b5a..dc3a1a2f3 100644 --- a/tests/Datasets/StoreEngagementRequestValidationErrors.php +++ b/tests/Datasets/StoreEngagementRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['project_id' => null], 'errors' => fn () => ['project_id' => __('validation.required', ['attribute' => __('project id')])], @@ -29,5 +29,5 @@ 'state' => ['who' => 'other'], 'errors' => fn () => ['who' => __('validation.exists', ['attribute' => __('who')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreOrganizationLanguagesRequestValidationErrors.php b/tests/Datasets/StoreOrganizationLanguagesRequestValidationErrors.php index 7dd4cb520..49accae7e 100644 --- a/tests/Datasets/StoreOrganizationLanguagesRequestValidationErrors.php +++ b/tests/Datasets/StoreOrganizationLanguagesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['roles' => null], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])], @@ -14,5 +14,5 @@ 'state' => ['languages' => []], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreOrganizationRequestValidationErrors.php b/tests/Datasets/StoreOrganizationRequestValidationErrors.php index f46e0335a..d2ce75744 100644 --- a/tests/Datasets/StoreOrganizationRequestValidationErrors.php +++ b/tests/Datasets/StoreOrganizationRequestValidationErrors.php @@ -3,7 +3,7 @@ use App\Models\Organization; dataset('storeOrganizationRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Type is missing' => [ 'state' => ['type' => null], 'errors' => fn () => ['type' => __('validation.required', ['attribute' => __('organization type')])], @@ -26,5 +26,5 @@ 'name.fr' => __('An organization with this name already exists on our website. Please contact your colleagues to get an invitation. If this isn’t your organization, please use a different name.'), ], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreOrganizationTypeRequestValidationErrors.php b/tests/Datasets/StoreOrganizationTypeRequestValidationErrors.php index 737fdfe52..b6ae1892b 100644 --- a/tests/Datasets/StoreOrganizationTypeRequestValidationErrors.php +++ b/tests/Datasets/StoreOrganizationTypeRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['type' => null], 'errors' => fn () => ['type' => __('You must select what type of organization you are.')], @@ -10,5 +10,5 @@ 'state' => ['type' => 'other'], 'errors' => fn () => ['type' => __('validation.exists', ['attribute' => __('organization type')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreProjectContextRequestValidationErrors.php b/tests/Datasets/StoreProjectContextRequestValidationErrors.php index e94f86547..8c6dc943d 100644 --- a/tests/Datasets/StoreProjectContextRequestValidationErrors.php +++ b/tests/Datasets/StoreProjectContextRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['context' => null], 'errors' => fn () => ['context' => __('validation.required', ['attribute' => __('project context')])], @@ -26,5 +26,5 @@ 'state' => ['ancestor' => 1000000, 'context' => 'new'], 'errors' => fn () => ['ancestor' => __('validation.exists', ['attribute' => __('previous project')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreProjectLanguagesRequestValidationErrors.php b/tests/Datasets/StoreProjectLanguagesRequestValidationErrors.php index d100ff934..4b3d7ab0d 100644 --- a/tests/Datasets/StoreProjectLanguagesRequestValidationErrors.php +++ b/tests/Datasets/StoreProjectLanguagesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['languages' => null], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('project languages')])], @@ -14,5 +14,5 @@ 'state' => ['languages' => []], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('project languages')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreProjectRequestValidationErrors.php b/tests/Datasets/StoreProjectRequestValidationErrors.php index 790e59f2c..50e928060 100644 --- a/tests/Datasets/StoreProjectRequestValidationErrors.php +++ b/tests/Datasets/StoreProjectRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['projectable_type' => null], 'errors' => fn () => ['projectable_type' => __('validation.required', ['attribute' => __('projectable type')])], @@ -53,5 +53,5 @@ 'state' => ['name.en' => false], 'errors' => fn () => ['name.en' => __('validation.string', ['attribute' => __('project name (English)')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreRegulatedOrganizationLanguagesRequestValidationErrors.php b/tests/Datasets/StoreRegulatedOrganizationLanguagesRequestValidationErrors.php index 345868a78..5c0fc5658 100644 --- a/tests/Datasets/StoreRegulatedOrganizationLanguagesRequestValidationErrors.php +++ b/tests/Datasets/StoreRegulatedOrganizationLanguagesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['languages' => null], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])], @@ -10,5 +10,5 @@ 'state' => ['languages' => false], 'errors' => fn () => ['languages' => __('validation.array', ['attribute' => __('languages')])], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreRegulatedOrganizationRequestValidationErrors.php b/tests/Datasets/StoreRegulatedOrganizationRequestValidationErrors.php index 55cf14b54..ab686a287 100644 --- a/tests/Datasets/StoreRegulatedOrganizationRequestValidationErrors.php +++ b/tests/Datasets/StoreRegulatedOrganizationRequestValidationErrors.php @@ -6,7 +6,7 @@ dataset('storeRegulatedOrganizationRequestValidationErrors', function () { $businessType = RegulatedOrganizationType::Business->value; - return array_map('array_values', [ + return [ 'Type is missing' => [ 'state' => ['type' => null], 'errors' => fn () => ['type' => __('validation.required', ['attribute' => __('organization type')])], @@ -36,5 +36,5 @@ 'name.fr' => __('A :type with this name already exists.', ['type' => $businessType]), ], ], - ]); + ]; }); diff --git a/tests/Datasets/StoreRegulatedOrganizationTypeRequestValidationErrors.php b/tests/Datasets/StoreRegulatedOrganizationTypeRequestValidationErrors.php index 64f4fe411..c3021c51c 100644 --- a/tests/Datasets/StoreRegulatedOrganizationTypeRequestValidationErrors.php +++ b/tests/Datasets/StoreRegulatedOrganizationTypeRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['type' => null], 'errors' => fn () => ['type' => __('You must select what type of organization you are.')], @@ -14,5 +14,5 @@ 'state' => ['type' => 'other'], 'errors' => fn () => ['type' => __('validation.exists', ['attribute' => __('organization type')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateEngagementLanguagesRequestValidationErrors.php b/tests/Datasets/UpdateEngagementLanguagesRequestValidationErrors.php index 4fbd616b9..0a5d80478 100644 --- a/tests/Datasets/UpdateEngagementLanguagesRequestValidationErrors.php +++ b/tests/Datasets/UpdateEngagementLanguagesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['languages' => null], 'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])], @@ -18,5 +18,5 @@ 'state' => ['languages' => ['xyz']], 'errors' => fn () => ['languages.0' => __('validation.exists', ['attribute' => __('languages')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateEngagementRequestValidationErrors.php b/tests/Datasets/UpdateEngagementRequestValidationErrors.php index 78eaccd9b..c0da88d8e 100644 --- a/tests/Datasets/UpdateEngagementRequestValidationErrors.php +++ b/tests/Datasets/UpdateEngagementRequestValidationErrors.php @@ -6,7 +6,7 @@ use App\Enums\MeetingType; dataset('updateEngagementRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Name is missing' => [ ['name' => null], fn () => [ @@ -648,5 +648,5 @@ 'meetingType' => MeetingType::InPerson->value, ], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateIndividualCommunicationAndConsultationPreferencesRequestValidationErrors.php b/tests/Datasets/UpdateIndividualCommunicationAndConsultationPreferencesRequestValidationErrors.php index c38786775..1b17e8d43 100644 --- a/tests/Datasets/UpdateIndividualCommunicationAndConsultationPreferencesRequestValidationErrors.php +++ b/tests/Datasets/UpdateIndividualCommunicationAndConsultationPreferencesRequestValidationErrors.php @@ -4,7 +4,7 @@ use App\Models\User; dataset('updateIndividualCommunicationAndConsultationPreferencesRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Preferred contact person is missing' => [ 'state' => ['preferred_contact_person' => null], 'errors' => fn () => ['preferred_contact_person' => __('validation.required', ['attribute' => __('Preferred contact person')])], @@ -121,5 +121,5 @@ 'state' => ['meeting_types' => ['other']], 'errors' => fn () => ['meeting_types.0' => __('validation.exists', ['attribute' => __('Ways to attend')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateIndividualConstituenciesRequestValidationErrors.php b/tests/Datasets/UpdateIndividualConstituenciesRequestValidationErrors.php index 9a7687bb5..af5731768 100644 --- a/tests/Datasets/UpdateIndividualConstituenciesRequestValidationErrors.php +++ b/tests/Datasets/UpdateIndividualConstituenciesRequestValidationErrors.php @@ -3,7 +3,7 @@ use App\Enums\BaseDisabilityType; dataset('updateIndividualConstituenciesRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Disability and deaf is missing' => [ 'state' => [ 'disability_and_deaf' => null, @@ -321,5 +321,5 @@ 'state' => ['connection_lived_experience' => 'other'], 'errors' => fn () => ['connection_lived_experience' => __('validation.exists', ['attribute' => __('connection lived experience')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateIndividualExperiencesRequestValidationErrors.php b/tests/Datasets/UpdateIndividualExperiencesRequestValidationErrors.php index 1054a30a2..8ea3b9521 100644 --- a/tests/Datasets/UpdateIndividualExperiencesRequestValidationErrors.php +++ b/tests/Datasets/UpdateIndividualExperiencesRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['lived_experience' => 123], 'errors' => fn () => ['lived_experience' => __('validation.array', ['attribute' => __('Lived experience')])], @@ -230,5 +230,5 @@ ]], 'errors' => fn () => ['relevant_experiences.0.current' => __('validation.boolean', ['attribute' => __('I currently work or volunteer here')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateIndividualInterestsRequestValidationErrors.php b/tests/Datasets/UpdateIndividualInterestsRequestValidationErrors.php index 61b7af280..c4256401b 100644 --- a/tests/Datasets/UpdateIndividualInterestsRequestValidationErrors.php +++ b/tests/Datasets/UpdateIndividualInterestsRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['sectors' => 123], 'errors' => fn () => ['sectors' => __('validation.array', ['attribute' => __('Regulated Organization type')])], @@ -18,5 +18,5 @@ 'state' => ['impacts' => [100000]], 'errors' => fn () => ['impacts.0' => __('validation.exists', ['attribute' => __('area of accessibility planning and design')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateIndividualRequestValidationErrors.php b/tests/Datasets/UpdateIndividualRequestValidationErrors.php index 88ca54218..ef7d5f70a 100644 --- a/tests/Datasets/UpdateIndividualRequestValidationErrors.php +++ b/tests/Datasets/UpdateIndividualRequestValidationErrors.php @@ -3,7 +3,7 @@ use App\Enums\ConsultingService; dataset('updateIndividualRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Missing name' => [ ['name' => null], fn () => ['name' => __('validation.required', ['attribute' => __('full name')])], @@ -80,5 +80,5 @@ ['website_link' => 'https://example.fake/'], fn () => ['website_link' => __('You must enter a valid website link.')], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateOrganizationConstituenciesRequestValidationErrors.php b/tests/Datasets/UpdateOrganizationConstituenciesRequestValidationErrors.php index d7931401e..1e2606952 100644 --- a/tests/Datasets/UpdateOrganizationConstituenciesRequestValidationErrors.php +++ b/tests/Datasets/UpdateOrganizationConstituenciesRequestValidationErrors.php @@ -6,7 +6,7 @@ dataset('updateOrganizationConstituenciesRequestValidationErrors', function () { $orgState = ['type' => OrganizationType::Representative->value]; - return array_map('array_values', [ + return [ 'Disability and deaf is not a boolean' => [ 'orgState' => $orgState, 'state' => ['disability_and_deaf' => 123], @@ -372,5 +372,5 @@ 'state' => ['staff_lived_experience' => 'other'], 'errors' => fn () => ['staff_lived_experience' => __('validation.exists', ['attribute' => __('Staff lived experience')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateOrganizationContactInformationRequestValidationErrors.php b/tests/Datasets/UpdateOrganizationContactInformationRequestValidationErrors.php index beef815a4..d5adde128 100644 --- a/tests/Datasets/UpdateOrganizationContactInformationRequestValidationErrors.php +++ b/tests/Datasets/UpdateOrganizationContactInformationRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['contact_person_name' => null], 'errors' => fn () => ['contact_person_name' => __('validation.required', ['attribute' => __('Contact person')])], @@ -69,5 +69,5 @@ 'state' => ['preferred_contact_language' => 'xx'], 'errors' => fn () => ['preferred_contact_language' => __('validation.exists', ['attribute' => __('preferred contact language')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateOrganizationInterestsRequestValidationErrors.php b/tests/Datasets/UpdateOrganizationInterestsRequestValidationErrors.php index 16f2e2f3c..4ba359653 100644 --- a/tests/Datasets/UpdateOrganizationInterestsRequestValidationErrors.php +++ b/tests/Datasets/UpdateOrganizationInterestsRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['impacts' => 123], 'errors' => fn () => ['impacts' => __('validation.array', ['attribute' => __('area of accessibility planning and design')])], @@ -18,5 +18,5 @@ 'state' => ['sectors' => [1000000]], 'errors' => fn () => ['sectors.0' => __('validation.exists', ['attribute' => __('Regulated Organization type')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateOrganizationRequestValidationErrors.php b/tests/Datasets/UpdateOrganizationRequestValidationErrors.php index f0b8914ec..c674f54a8 100644 --- a/tests/Datasets/UpdateOrganizationRequestValidationErrors.php +++ b/tests/Datasets/UpdateOrganizationRequestValidationErrors.php @@ -3,7 +3,7 @@ use App\Models\Organization; dataset('updateOrganizationRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Name is missing' => [ 'state' => ['name' => null], 'errors' => fn () => [ @@ -103,5 +103,5 @@ 'state' => ['website_link' => 'fake.example.com'], 'errors' => fn () => ['website_link' => __('validation.active_url', ['attribute' => __('Website link')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateProjectRequestValidationErrors.php b/tests/Datasets/UpdateProjectRequestValidationErrors.php index cb470f8a9..d153a3470 100644 --- a/tests/Datasets/UpdateProjectRequestValidationErrors.php +++ b/tests/Datasets/UpdateProjectRequestValidationErrors.php @@ -3,7 +3,7 @@ use Carbon\Carbon; dataset('updateProjectRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Name is missing' => [ 'state' => ['name' => null], 'errors' => fn () => [ @@ -163,5 +163,5 @@ 'state' => ['public_outcomes' => 123], 'errors' => fn () => ['public_outcomes' => __('validation.boolean', ['attribute' => __('public outcomes')])], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateProjectTeamRequestValidationErrors.php b/tests/Datasets/UpdateProjectTeamRequestValidationErrors.php index 5c9d32310..82d9aecbe 100644 --- a/tests/Datasets/UpdateProjectTeamRequestValidationErrors.php +++ b/tests/Datasets/UpdateProjectTeamRequestValidationErrors.php @@ -1,7 +1,7 @@ [ 'state' => ['team_size' => 'test'], 'errors' => fn () => ['team_size' => __('validation.array', ['attribute' => __('team size')])], @@ -85,5 +85,5 @@ ], 'without' => ['contact_person_response_time'], ], - ]); + ]; }); diff --git a/tests/Datasets/UpdateRegulatedOrganizationRequestValidationErrors.php b/tests/Datasets/UpdateRegulatedOrganizationRequestValidationErrors.php index cdf4499f8..ca9629af3 100644 --- a/tests/Datasets/UpdateRegulatedOrganizationRequestValidationErrors.php +++ b/tests/Datasets/UpdateRegulatedOrganizationRequestValidationErrors.php @@ -3,7 +3,7 @@ use App\Models\RegulatedOrganization; dataset('updateRegulatedOrganizationRequestValidationErrors', function () { - return array_map('array_values', [ + return [ 'Name is missing' => [ 'state' => ['name' => null], 'errors' => fn () => [ @@ -194,5 +194,5 @@ 'state' => ['preferred_contact_language' => 'xx'], 'errors' => fn () => ['preferred_contact_language' => __('validation.exists', ['attribute' => __('preferred contact language')])], ], - ]); + ]; }); diff --git a/tests/Feature/EngagementTest.php b/tests/Feature/EngagementTest.php index c04108fd3..9f5f764c1 100644 --- a/tests/Feature/EngagementTest.php +++ b/tests/Feature/EngagementTest.php @@ -1517,7 +1517,7 @@ ->assertRedirect($redirectRoute); }); -dataset('joinedEngagementsAccessByRoles', array_map('array_values', [ +dataset('joinedEngagementsAccessByRoles', [ 'no roles' => [ 'roles' => [], 'routes' => [ @@ -1550,9 +1550,9 @@ 'engagements.joined-participating' => true, ], ], -])); +]); -dataset('joinedByEngagement', array_map('array_values', [ +dataset('joinedByEngagement', [ 'no engagements' => [ 'engagements' => [], 'engagementRoutes' => [], @@ -1604,7 +1604,7 @@ 'engagements.joined-participating' => true, ], ], -])); +]); test('Engagements I’ve joined pages for Individuals', function ($roles, $routes, $engagements, $engagementRoutes) { $user = User::factory()->create(); @@ -1741,7 +1741,7 @@ ->with('joinedEngagementsAccessByRoles') ->with('joinedByEngagement'); -dataset('joinedEngagementsByRoles', array_map('array_values', [ +dataset('joinedEngagementsByRoles', [ 'community connector' => [ 'roles' => [IndividualRole::CommunityConnector->value], 'routes' => [ @@ -1756,9 +1756,9 @@ 'engagements.joined-participating', ], ], -])); +]); -dataset('engagementActiveStates', array_map('array_values', [ +dataset('engagementActiveStates', [ 'no engagements' => [ 'engagementStates' => [ 'active' => false, @@ -1783,7 +1783,7 @@ 'complete' => true, ], ], -])); +]); test('Engagements I’ve joined engagement lists for Individuals', function ($roles, $routes, $engagementStates) { $user = User::factory()->create(); diff --git a/tests/Feature/PageTest.php b/tests/Feature/PageTest.php index 9e4593c4b..c3f11718b 100644 --- a/tests/Feature/PageTest.php +++ b/tests/Feature/PageTest.php @@ -27,7 +27,7 @@ $rendered, ], false) ->assertViewIs('about.show-page'); -})->with(array_map('array_values', [ +})->with([ 'Terms of Service' => [ 'routeName' => 'about.terms-of-service', 'title' => 'Terms of Service', @@ -43,7 +43,7 @@ 'title' => 'Test Page', 'withParam' => true, ], -]))->with(array_map('array_values', [ +])->with([ 'Null content' => [ 'input' => null, 'output' => 'Coming soon', @@ -56,7 +56,7 @@ 'input' => '## Heading', 'output' => '

Heading

', ], -])); +]); test('ToS contents with interpolated data', function (string $routeName, string $title, bool $withParam = false) { $page = Page::factory()->create([ @@ -77,7 +77,7 @@ localized_route('about.terms-of-service'), 'href="mailto:'.settings_localized('email_privacy', locale()).'"', ], false); -})->with(array_map('array_values', [ +})->with([ 'Terms of Service' => [ 'routeName' => 'about.terms-of-service', 'title' => 'Terms of Service', @@ -91,4 +91,4 @@ 'title' => 'Test Page', 'withParam' => true, ], -])); +]); diff --git a/tests/Feature/ProjectTest.php b/tests/Feature/ProjectTest.php index 41eba7134..5893f526b 100644 --- a/tests/Feature/ProjectTest.php +++ b/tests/Feature/ProjectTest.php @@ -921,7 +921,7 @@ $response->assertDontSee($item); } -})->with(array_map('array_values', [ +})->with([ 'organization' => [ 'userContext' => UserContext::Organization->value, 'modelClass' => Organization::class, @@ -930,7 +930,7 @@ 'userContext' => UserContext::RegulatedOrganization->value, 'modelClass' => RegulatedOrganization::class, ], -]))->with(array_map('array_values', [ +])->with([ 'draft' => [ 'projectState' => [ 'published_at' => null, @@ -959,7 +959,7 @@ 'toSee' => ['Completed'], 'dontSee' => ['Draft', 'In progress', 'Upcoming'], ], -])); +]); test('test project statuses scope', function () { $upcomingProject = Project::factory()->create([ diff --git a/tests/Unit/SafeNL2BRHelperTest.php b/tests/Unit/SafeNL2BRHelperTest.php index a6a683dd5..71496192a 100644 --- a/tests/Unit/SafeNL2BRHelperTest.php +++ b/tests/Unit/SafeNL2BRHelperTest.php @@ -11,7 +11,7 @@ })->with([ 'xhtml compatible breaks' => true, 'xhmtl incompatible breaks' => false, -])->with(array_map('array_values', [ +])->with([ 'plain string' => [ 'input' => 'Text', 'output' => 'Text', @@ -28,4 +28,4 @@ 'output' => '<strong>Before</strong>%break% After', ], -])); +]);