stable

Clone or download

Read-only

[feature] Create dry_run option for POST projects/

This is part of story #21386 dry run REST project creation When adding the ?dry_run=true to the REST route POST /projects, then the project creation is not done but it's checked. It returns a 204 if all is OK, and a 400 if there are errors. No new check is added, this patch centralize the permissions checks done for project creation. Technical point --------------- ProjectFieldsResource does not use yet the new object because it will introduce a change in the logic. The update will be done in a dedicated commit. Integration test ProjectCreationTest has been removed because it tested the old SOAP entrypoint. In addition, creation of project is already tested in REST testsuite and when doing XML imports for REST / SOAP tests. Change-Id: If102d81eab0938b2df3962b4df6554cd39799b52

Modified Files

Name
M site-content/fr_FR/LC_MESSAGES/tuleap-core.po +15 −0 Go to diff View file
M src/common/Project/ProjectCreator.class.php +22 −34 Go to diff View file
M src/common/Project/REST/v1/ProjectResource.class.php +25 −2 Go to diff View file
M src/common/Project/REST/v1/RestProjectCreator.php +4 −5 Go to diff View file
M src/common/Project/Registration/AnonymousNotAllowedException.php +9 −0 Go to diff View file
M src/common/Project/Registration/LimitedToSiteAdministratorsException.php +8 −0 Go to diff View file
R src/common/Project/Registration/MaxNumberOfProjectReachedException.php Go to diff View file
A src/common/Project/Registration/MaxNumberOfProjectReachedForUserException.php +37 −0 Go to diff View file
A src/common/Project/Registration/ProjectRegistrationChecker.php +49 −0 Go to diff View file
A src/common/Project/Registration/ProjectRegistrationErrorsCollection.php +58 −0 Go to diff View file
M src/common/Project/Registration/ProjectRegistrationUserPermissionChecker.php +13 −12 Go to diff View file
M src/common/Project/Registration/RegistrationForbiddenException.php +2 −1 Go to diff View file
M src/common/Project/Registration/RestrictedUsersNotAllowedException.php +9 −0 Go to diff View file
M src/common/REST/v1/ProjectFieldsResource.php +3 −3 Go to diff View file
M src/common/layout/NewDropdown/NewDropdownPresenterBuilder.php +11 −7 Go to diff View file
M src/themes/BurningParrot/include/BurningParrotTheme.php +5 −2 Go to diff View file
M src/www/themes/FlamingParrot/FlamingParrot_Theme.class.php +8 −4 Go to diff View file
D tests/integration/tests/ProjectCreationTest.php +0 −104 Go to diff View file
M tests/rest/lib/TuleapConfig.php +10 −0 Go to diff View file
M tests/rest/tests/ProjectTest.php +273 −210 Go to diff View file
M tests/unit/common/Project/ProjectCreatorTest.php +23 −1 Go to diff View file
M tests/unit/common/Project/ProjectXMLImporterTest.php +2 −0 Go to diff View file
M tests/unit/common/Project/REST/v1/RestProjectCreatorTest.php +30 −2 Go to diff View file
M tests/unit/common/Project/Registration/ProjectRegistrationUserPermissionCheckerTest.php +4 −3 Go to diff View file
M tests/unit/common/layout/NewDropdown/NewDropdownPresenterBuilderTest.php +81 −39 Go to diff View file