-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: validation error with only other for outcome analysis (resolves #…
…2057) (#2104) * fix: validation error with only other for outcome analysis * test: add missing test case * test: add coverage for UpdateProjectTeamRequest * test: add coverage for DestroyProjectRequest * test: add coverage for StoreProjectRequest * test: clean up project test * test: add coverage for StoreProjectLanguagesRequest * test: add coverage for StoreProjectContextRequest * fix: publishable check failing with outcome analysis other
- Loading branch information
Showing
20 changed files
with
692 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
dataset('destroyProjectRequestValidationErrors', function () { | ||
return [ | ||
'Current password is missing' => [ | ||
'state' => [], | ||
'errors' => fn () => ['current_password' => __('validation.required', ['attribute' => __('current password')])], | ||
], | ||
'Current password is not a string' => [ | ||
'state' => ['current_password' => false], | ||
'errors' => fn () => ['current_password' => __('validation.string', ['attribute' => __('current password')])], | ||
], | ||
'Current password is not valid' => [ | ||
'state' => ['current_password' => 'WrongPassword'], | ||
'errors' => fn () => ['current_password' => __('The provided password does not match your current password.')], | ||
], | ||
]; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/Datasets/StoreProjectContextRequestValidationErrors.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
dataset('storeProjectContextRequestValidationErrors', function () { | ||
return [ | ||
'Context type is missing' => [ | ||
'state' => ['context' => null], | ||
'errors' => fn () => ['context' => __('validation.required', ['attribute' => __('project context')])], | ||
], | ||
'Context is not a string' => [ | ||
'state' => ['context' => false], | ||
'errors' => fn () => ['context' => __('validation.string', ['attribute' => __('project context')])], | ||
], | ||
'Context is not valid' => [ | ||
'state' => ['context' => 'old'], | ||
'errors' => fn () => ['context' => __('validation.exists', ['attribute' => __('project context')])], | ||
], | ||
'Ancestor is not an integer' => [ | ||
'state' => ['ancestor' => false, 'context' => 'new'], | ||
'errors' => fn () => ['ancestor' => __('validation.integer', ['attribute' => __('previous project')])], | ||
], | ||
'Ancestor is missing' => [ | ||
'state' => ['ancestor' => null, 'context' => 'follow-up'], | ||
'errors' => fn () => ['ancestor' => __('Since this is a follow-up to a previous project, you must specify the previous project.')], | ||
], | ||
'Ancestor is invalid' => [ | ||
'state' => ['ancestor' => 1000000, 'context' => 'new'], | ||
'errors' => fn () => ['ancestor' => __('validation.exists', ['attribute' => __('previous project')])], | ||
], | ||
]; | ||
}); |
18 changes: 18 additions & 0 deletions
18
tests/Datasets/StoreProjectLanguagesRequestValidationErrors.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
dataset('storeProjectLanguagesRequestValidationErrors', function () { | ||
return [ | ||
'Languages type is missing' => [ | ||
'state' => ['languages' => null], | ||
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('project languages')])], | ||
], | ||
'Languages is not an array' => [ | ||
'state' => ['languages' => false], | ||
'errors' => fn () => ['languages' => __('validation.array', ['attribute' => __('project languages')])], | ||
], | ||
'Languages array is empty' => [ | ||
'state' => ['languages' => []], | ||
'errors' => fn () => ['languages' => __('validation.required', ['attribute' => __('project languages')])], | ||
], | ||
]; | ||
}); |
Oops, something went wrong.