Skip to content

Commit

Permalink
Revert "test: fix deprecation errors (#2351)"
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Dec 1, 2024
1 parent 4f2b96a commit af87400
Show file tree
Hide file tree
Showing 40 changed files with 89 additions and 89 deletions.
4 changes: 2 additions & 2 deletions tests/Datasets/AddOrganizationValidationErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')])],
Expand All @@ -20,5 +20,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 array_map('array_values', $testCases);
return $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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 array_map('array_values', [
return [
'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 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')])],
Expand Down Expand Up @@ -121,5 +121,5 @@
'state' => ['meeting_types' => ['other']],
'errors' => fn () => ['meeting_types.0' => __('validation.exists', ['attribute' => __('Ways to attend')])],
],
]);
];
});
Loading

0 comments on commit af87400

Please sign in to comment.