stable

Clone or download

Read-only

Refactoring: Extract project retriever

Part of story #14541 have OAuth2 project admin Project admin has more and more controllers. They should all check that the given project is not null and not in error. This contribution introduces a dedicated object for that purpose. The GetProjectTrait usage has also been replaced. The Trait is fine except that the IDE does not warn us when we forget injecting ProjectManager in the constructor. I decided to go with the regular Class. No functional change expected in project admin or FRS licenses admin. Change-Id: I03587af6f3fa3c1d7e1ecfbe44dc0315965425c0

Modified Files

Name
M plugins/project_ownership/include/ProjectAdmin/IndexController.php +28 −26 Go to diff View file
M plugins/project_ownership/include/project_ownershipPlugin.php +1 −13 Go to diff View file
A plugins/project_ownership/phpunit/ProjectAdmin/IndexControllerTest.php +76 −0 Go to diff View file
M plugins/project_ownership/site-content/fr_FR/LC_MESSAGES/tuleap-project_ownership.po +0 −3 Go to diff View file
M src/common/FRS/LicenseAgreement/Admin/AddLicenseAgreementController.php +32 −20 Go to diff View file
M src/common/FRS/LicenseAgreement/Admin/EditLicenseAgreementController.php +29 −10 Go to diff View file
M src/common/FRS/LicenseAgreement/Admin/ListLicenseAgreementsController.php +37 −14 Go to diff View file
M src/common/FRS/LicenseAgreement/Admin/SaveLicenseAgreementController.php +33 −11 Go to diff View file
M src/common/FRS/LicenseAgreement/Admin/SetDefaultLicenseAgreementController.php +30 −17 Go to diff View file
M src/common/Project/Admin/Categories/IndexController.php +13 −18 Go to diff View file
M src/common/Project/Admin/Categories/UpdateController.php +19 −20 Go to diff View file
M src/common/Project/Admin/ProjectMembers/ProjectMembersController.php +75 −30 Go to diff View file
M src/common/Project/Admin/ProjectUGroup/MemberAdditionController.php +30 −14 Go to diff View file
M src/common/Project/Admin/ProjectUGroup/MemberRemovalController.php +61 −18 Go to diff View file
M src/common/Project/Admin/ProjectUGroup/SynchronizedProjectMembership/ActivationController.php +19 −21 Go to diff View file
M src/common/Project/Banner/BannerAdministrationController.php +18 −19 Go to diff View file
M src/common/Project/Service/AddController.php +26 −22 Go to diff View file
M src/common/Project/Service/DeleteController.php +22 −23 Go to diff View file
M src/common/Project/Service/EditController.php +23 −22 Go to diff View file
M src/common/Project/Service/IndexController.php +19 −18 Go to diff View file
R src/common/Request/GetProjectTrait.php Go to diff View file
M src/common/Request/RouteCollector.php +18 −220 Go to diff View file
A tests/phpunit/common/FRS/LicenseAgreement/Admin/AddLicenseAgreementControllerTest.php +108 −0 Go to diff View file
M tests/phpunit/common/FRS/LicenseAgreement/Admin/EditLicenseAgreementControllerTest.php +15 −11 Go to diff View file
M tests/phpunit/common/FRS/LicenseAgreement/Admin/ListLicenseAgreementsControllerTest.php +12 −8 Go to diff View file
M tests/phpunit/common/FRS/LicenseAgreement/Admin/SaveLicenseAgreementControllerTest.php +15 −10 Go to diff View file
M tests/phpunit/common/FRS/LicenseAgreement/Admin/SetDefaultLicenseAgreementControllerTest.php +11 −8 Go to diff View file
A tests/phpunit/common/Project/Admin/Categories/IndexControllerTest.php +67 −0 Go to diff View file
M tests/phpunit/common/Project/Admin/Categories/UpdateControllerTest.php +15 −25 Go to diff View file
A tests/phpunit/common/Project/Admin/ProjectMembers/ProjectMembersControllerTest.php +101 −0 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectUGroup/MemberAdditionControllerTest.php +30 −14 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectUGroup/MemberRemovalControllerTest.php +37 −17 Go to diff View file
M tests/phpunit/common/Project/Admin/ProjectUGroup/SynchronizedProjectMembership/ActivationControllerTest.php +11 −29 Go to diff View file
M tests/phpunit/common/Project/Banner/BannerAdministrationControllerTest.php +12 −9 Go to diff View file
A tests/phpunit/common/Project/Service/AddControllerTest.php +72 −0 Go to diff View file
M tests/phpunit/common/Project/Service/DeleteControllerTest.php +27 −16 Go to diff View file
A tests/phpunit/common/Project/Service/EditControllerTest.php +73 −0 Go to diff View file
A tests/phpunit/common/Project/Service/IndexControllerTest.php +78 −0 Go to diff View file
A tests/phpunit/common/Request/ProjectRetrieverTest.php +89 −0 Go to diff View file