Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix deprecation errors #2351

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Datasets/AddOrganizationValidationErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use App\Models\Organization;

dataset('addOrganizationValidationErrors', function () {
return [
return array_map('array_values', [
'Organization id is missing' => [
'state' => ['organization_id' => null],
'errors' => fn () => ['organization_id' => __('validation.required', ['attribute' => __('organization.singular_name')])],
Expand All @@ -19,5 +19,5 @@
])->id],
'errors' => fn () => ['organization_id' => __('The organization you have added does not participate in engagements.')],
],
];
]);
});
2 changes: 1 addition & 1 deletion tests/Datasets/BrowseEngagementsFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
];
}

return $testCases;
return array_map('array_values', $testCases);
});
4 changes: 2 additions & 2 deletions tests/Datasets/DestroyIndividualRequestValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('destroyIndividualRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Current password is missing' => [
'state' => ['current_password' => null],
'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])],
Expand All @@ -14,5 +14,5 @@
'state' => ['current_password' => 'fake_password'],
'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/DestroyOrganizationRequestValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('destroyOrganizationRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Current password is missing' => [
'state' => ['current_password' => null],
'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])],
Expand All @@ -14,5 +14,5 @@
'state' => ['current_password' => 'fake_password'],
'errors' => fn () => ['current_password' => __('validation.current_password', ['attribute' => __('current password')])],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/DestroyProjectRequestValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('destroyProjectRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Current password is missing' => [
'state' => [],
'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])],
Expand All @@ -14,5 +14,5 @@
'state' => ['current_password' => 'WrongPassword'],
'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('destroyRegulatedOrganizationRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Current password is missing' => [
'state' => ['current_password' => null],
'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])],
Expand All @@ -14,5 +14,5 @@
'state' => ['current_password' => 'fake_password'],
'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/InviteParticipantValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('inviteParticipantValidationErrors', function () {
return [
return array_map('array_values', [
'Email is missing' => [
'state' => ['email' => null],
'errors' => fn () => ['email' => __('You must enter an email address.')],
Expand All @@ -22,5 +22,5 @@
'state' => ['email' => '[email protected]'],
'errors' => fn () => ['email' => __('The person with the email address you provided is not a consultation participant.')],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('saveOrganizationRolesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Roles is missing' => [
'state' => ['roles' => null],
'errors' => fn () => ['roles' => __('You must select a role for your organization.')],
Expand All @@ -14,5 +14,5 @@
'state' => ['roles' => ['other']],
'errors' => fn () => ['roles.0' => __('validation.exists', ['attribute' => __('roles')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeAccessNeedsPermissionsValidationErrors', function () {
return [
return array_map('array_values', [
'Share access needs is missing' => [
'state' => [],
'errors' => fn () => ['share_access_needs' => __('validation.required', ['attribute' => __('share access needs')])],
Expand All @@ -10,5 +10,5 @@
'state' => ['share_access_needs' => 123],
'errors' => fn () => ['share_access_needs' => __('validation.boolean', ['attribute' => __('share access needs')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeEngagementFormatRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Format is missing' => [
'state' => ['format' => null],
'errors' => fn () => ['format' => __('validation.required', ['attribute' => __('engagement format')])],
Expand All @@ -10,5 +10,5 @@
'state' => ['format' => ['xyz']],
'errors' => fn () => ['format' => __('validation.exists', ['attribute' => __('engagement format')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeEngagementLanguagesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Languages is missing' => [
'state' => ['languages' => null],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])],
Expand All @@ -18,5 +18,5 @@
'state' => ['languages' => ['xyz']],
'errors' => fn () => ['languages.0' => __('validation.exists', ['attribute' => __('languages')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeEngagementRecruitmentRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Recruitment is missing' => [
'state' => ['recruitment' => null],
'errors' => fn () => ['recruitment' => __('validation.required', ['attribute' => __('recruitment method')])],
Expand All @@ -10,5 +10,5 @@
'state' => ['recruitment' => ['xyz']],
'errors' => fn () => ['recruitment' => __('validation.exists', ['attribute' => __('recruitment method')])],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/StoreEngagementRequestValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeEngagementRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Project id is missing' => [
'state' => ['project_id' => null],
'errors' => fn () => ['project_id' => __('validation.required', ['attribute' => __('project id')])],
Expand Down Expand Up @@ -29,5 +29,5 @@
'state' => ['who' => 'other'],
'errors' => fn () => ['who' => __('validation.exists', ['attribute' => __('who')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeOrganizationLanguagesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Languages is missing' => [
'state' => ['roles' => null],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])],
Expand All @@ -14,5 +14,5 @@
'state' => ['languages' => []],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/StoreOrganizationRequestValidationErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use App\Models\Organization;

dataset('storeOrganizationRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Type is missing' => [
'state' => ['type' => null],
'errors' => fn () => ['type' => __('validation.required', ['attribute' => __('organization type')])],
Expand All @@ -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.'),
],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeOrganizationTypeRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Type is missing' => [
'state' => ['type' => null],
'errors' => fn () => ['type' => __('You must select what type of organization you are.')],
Expand All @@ -10,5 +10,5 @@
'state' => ['type' => 'other'],
'errors' => fn () => ['type' => __('validation.exists', ['attribute' => __('organization type')])],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/StoreProjectContextRequestValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeProjectContextRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Context type is missing' => [
'state' => ['context' => null],
'errors' => fn () => ['context' => __('validation.required', ['attribute' => __('project context')])],
Expand All @@ -26,5 +26,5 @@
'state' => ['ancestor' => 1000000, 'context' => 'new'],
'errors' => fn () => ['ancestor' => __('validation.exists', ['attribute' => __('previous project')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeProjectLanguagesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Languages type is missing' => [
'state' => ['languages' => null],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('project languages')])],
Expand All @@ -14,5 +14,5 @@
'state' => ['languages' => []],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('project languages')])],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/StoreProjectRequestValidationErrors.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeProjectRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Projectable type is missing' => [
'state' => ['projectable_type' => null],
'errors' => fn () => ['projectable_type' => __('validation.required', ['attribute' => __('projectable type')])],
Expand Down Expand Up @@ -53,5 +53,5 @@
'state' => ['name.en' => false],
'errors' => fn () => ['name.en' => __('validation.string', ['attribute' => __('project name (English)')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeRegulatedOrganizationLanguagesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Languages is missing' => [
'state' => ['languages' => null],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])],
Expand All @@ -10,5 +10,5 @@
'state' => ['languages' => false],
'errors' => fn () => ['languages' => __('validation.array', ['attribute' => __('languages')])],
],
];
]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dataset('storeRegulatedOrganizationRequestValidationErrors', function () {
$businessType = RegulatedOrganizationType::Business->value;

return [
return array_map('array_values', [
'Type is missing' => [
'state' => ['type' => null],
'errors' => fn () => ['type' => __('validation.required', ['attribute' => __('organization type')])],
Expand Down Expand Up @@ -36,5 +36,5 @@
'name.fr' => __('A :type with this name already exists.', ['type' => $businessType]),
],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('storeRegulatedOrganizationTypeRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Type is missing' => [
'state' => ['type' => null],
'errors' => fn () => ['type' => __('You must select what type of organization you are.')],
Expand All @@ -14,5 +14,5 @@
'state' => ['type' => 'other'],
'errors' => fn () => ['type' => __('validation.exists', ['attribute' => __('organization type')])],
],
];
]);
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

dataset('updateEngagementLanguagesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Languages is missing' => [
'state' => ['languages' => null],
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('languages')])],
Expand All @@ -18,5 +18,5 @@
'state' => ['languages' => ['xyz']],
'errors' => fn () => ['languages.0' => __('validation.exists', ['attribute' => __('languages')])],
],
];
]);
});
4 changes: 2 additions & 2 deletions tests/Datasets/UpdateEngagementRequestValidationErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use App\Enums\MeetingType;

dataset('updateEngagementRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Name is missing' => [
['name' => null],
fn () => [
Expand Down Expand Up @@ -648,5 +648,5 @@
'meetingType' => MeetingType::InPerson->value,
],
],
];
]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use App\Models\User;

dataset('updateIndividualCommunicationAndConsultationPreferencesRequestValidationErrors', function () {
return [
return array_map('array_values', [
'Preferred contact person is missing' => [
'state' => ['preferred_contact_person' => null],
'errors' => fn () => ['preferred_contact_person' => __('validation.required', ['attribute' => __('Preferred contact person')])],
Expand Down Expand Up @@ -121,5 +121,5 @@
'state' => ['meeting_types' => ['other']],
'errors' => fn () => ['meeting_types.0' => __('validation.exists', ['attribute' => __('Ways to attend')])],
],
];
]);
});
Loading
Loading