From d0c645f901dbfef3685a2112680db011c03c2b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Viguier?= Date: Wed, 16 Oct 2024 22:05:12 +0200 Subject: [PATCH] Move old api to Legacy (mark as V1) (#2498) * squash * Apply suggestions from code review Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com> * Update app/Legacy/V1/Middleware/LoginRequiredV1.php Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com> --------- Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com> --- .../{.env.mariadb => .env.legacy.mariadb} | 1 + ....env.postgresql => .env.legacy.postgresql} | 1 + .../{.env.sqlite => .env.legacy.sqlite} | 1 + .github/workflows/CICD.yml | 201 ++---------------- .github/workflows/js_check.yml | 32 +++ .github/workflows/php_dist.yml | 90 ++++++++ .github/workflows/php_tests.yml | 95 +++++++++ Makefile | 4 +- app/Actions/Album/PositionData.php | 2 +- app/Actions/Albums/PositionData.php | 2 +- app/Actions/Albums/Top.php | 10 +- app/Actions/Albums/Tree.php | 2 +- app/Actions/Sharing/ListShare.php | 2 +- app/DTO/TopAlbumDTO.php | 24 +++ app/Http/Kernel.php | 1 - app/Http/Middleware/RedirectLegacyPhotoID.php | 54 ----- .../Album/SetAlbumCopyrightRequest.php | 38 ---- .../Album/SetAlbumDescriptionRequest.php | 38 ---- .../Requests/Install/SetUpAdminRequest.php | 10 +- .../Requests/Legacy/TranslateIDRequest.php | 2 +- app/Http/Requests/Session/LoginRequest.php | 10 +- .../WebAuthn/DeleteCredentialRequest.php | 2 +- app/Http/RuleSets/AddAlbumRuleSet.php | 2 +- app/Http/RuleSets/Album/AddAlbumRuleSet.php | 2 +- .../RuleSets/Album/AddTagAlbumRuleSet.php | 2 +- .../RuleSets/Album/ArchiveAlbumRuleSet.php | 2 +- .../RuleSets/Album/BasicAlbumIdRuleSet.php | 2 +- .../RuleSets/Album/DeleteAlbumsRuleSet.php | 2 +- .../RuleSets/Album/MergeAlbumsRuleSet.php | 2 +- app/Http/RuleSets/Album/MoveAlbumsRuleSet.php | 2 +- .../Album/SetAlbumCopyrightRuleSet.php | 25 --- .../RuleSets/Album/SetAlbumCoverRuleSet.php | 2 +- .../Album/SetAlbumDescriptionRuleSet.php | 2 +- .../RuleSets/Album/SetAlbumHeaderRuleSet.php | 2 +- .../RuleSets/Album/SetAlbumLicenseRuleSet.php | 2 +- .../RuleSets/Album/SetAlbumNSFWRuleSet.php | 2 +- .../RuleSets/Album/SetAlbumSortingRuleSet.php | 2 +- .../Album/SetAlbumSortingRuleSetLegacy.php | 2 +- .../RuleSets/Album/SetAlbumTagRuleSet.php | 2 +- .../RuleSets/Album/SetAlbumsTitleRuleSet.php | 2 +- .../RuleSets/Album/SetPhotoSortingRuleSet.php | 2 +- .../RuleSets/Album/UnlockAlbumRuleSet.php | 2 +- app/Http/RuleSets/ChangeLoginRuleSet.php | 2 +- .../RuleSets/Import/ImportFromUrlRuleSet.php | 2 +- .../RuleSets/Import/ImportServerRuleSet.php | 2 +- app/Http/RuleSets/LoginRuleSet.php | 2 +- app/Http/RuleSets/Photo/AddPhotoRuleSet.php | 2 +- .../RuleSets/Photo/ArchivePhotosRuleSet.php | 2 +- .../RuleSets/Photo/DeletePhotosRuleSet.php | 2 +- .../RuleSets/Photo/DuplicatePhotosRuleSet.php | 2 +- app/Http/RuleSets/Photo/GetPhotoRuleSet.php | 2 +- app/Http/RuleSets/Photo/MovePhotosRuleSet.php | 2 +- .../RuleSets/Photo/RotatePhotoRuleSet.php | 2 +- .../Photo/SetPhotoDescriptionRuleSet.php | 2 +- .../RuleSets/Photo/SetPhotoLicenseRuleSet.php | 2 +- .../Photo/SetPhotoUploadDateRuleSet.php | 2 +- .../Photo/SetPhotosStarredRuleSet.php | 2 +- .../RuleSets/Photo/SetPhotosTagsRuleSet.php | 2 +- .../RuleSets/Photo/SetPhotosTitleRuleSet.php | 2 +- app/Http/RuleSets/Session/LoginRuleSet.php | 2 +- app/Http/RuleSets/User/ChangeLoginRuleSet.php | 2 +- app/Http/RuleSets/User/SetEmailRuleSet.php | 2 +- app/Http/RuleSets/Users/AddUserRuleSet.php | 2 +- .../RuleSets/Users/SetUserSettingsRuleSet.php | 2 +- .../WebAuthn/DeleteCredentialRuleSet.php | 2 +- .../Http/Requests/HasAbstractAlbum.php | 2 +- .../V1}/Contracts/Http/Requests/HasAlbum.php | 2 +- .../Contracts/Http/Requests/HasAlbumID.php | 2 +- .../Contracts/Http/Requests/HasAlbumIDs.php | 2 +- .../V1}/Contracts/Http/Requests/HasAlbums.php | 2 +- .../Contracts/Http/Requests/HasBaseAlbum.php | 2 +- .../Contracts/Http/Requests/HasCopyright.php | 2 +- .../V1}/Contracts/Http/Requests/HasDate.php | 2 +- .../Http/Requests/HasDescription.php | 2 +- .../Contracts/Http/Requests/HasIsPublic.php | 2 +- .../Contracts/Http/Requests/HasLicense.php | 2 +- .../Http/Requests/HasOptionalUser.php | 2 +- .../Http/Requests/HasParentAlbum.php | 2 +- .../Contracts/Http/Requests/HasPassword.php | 2 +- .../V1}/Contracts/Http/Requests/HasPhoto.php | 2 +- .../Contracts/Http/Requests/HasPhotoID.php | 2 +- .../Contracts/Http/Requests/HasPhotoIDs.php | 2 +- .../V1}/Contracts/Http/Requests/HasPhotos.php | 2 +- .../Http/Requests/HasSizeVariant.php | 2 +- .../Http/Requests/HasSortingCriterion.php | 2 +- .../Contracts/Http/Requests/HasTagAlbum.php | 2 +- .../V1}/Contracts/Http/Requests/HasTags.php | 2 +- .../V1}/Contracts/Http/Requests/HasTitle.php | 2 +- .../V1}/Contracts/Http/Requests/HasUser.php | 2 +- .../V1}/Contracts/Http/Requests/HasUserID.php | 2 +- .../Contracts/Http/Requests/HasUserIDs.php | 2 +- .../Contracts/Http/Requests/HasUsername.php | 2 +- .../Http/Requests/RequestAttribute.php | 2 +- .../Administration/DiagnosticsController.php | 2 +- .../Administration/JobController.php | 4 +- .../Administration/OptimizeController.php | 4 +- .../Administration/SettingsController.php | 46 ++-- .../Administration/SharingController.php | 12 +- .../Administration/UpdateController.php | 6 +- .../Administration/UserController.php | 10 +- .../Administration/UsersController.php | 12 +- .../V1}/Controllers/AlbumController.php | 52 ++--- .../V1}/Controllers/AlbumsController.php | 17 +- .../V1}/Controllers/ImportController.php | 10 +- .../V1}/Controllers/IndexController.php | 6 +- .../V1}/Controllers/LegacyController.php | 2 +- .../V1}/Controllers/PhotoController.php | 30 +-- .../V1}/Controllers/PhotoEditorController.php | 6 +- .../V1}/Controllers/RSSController.php | 2 +- .../V1}/Controllers/RedirectController.php | 2 +- .../V1}/Controllers/SearchController.php | 6 +- .../V1}/Controllers/SessionController.php | 4 +- app/Legacy/V1/Middleware/LoginRequiredV1.php | 72 +++++++ .../V1}/Requests/Album/AddAlbumRequest.php | 12 +- .../V1}/Requests/Album/AddTagAlbumRequest.php | 12 +- .../Requests/Album/ArchiveAlbumsRequest.php | 14 +- .../Requests/Album/DeleteAlbumsRequest.php | 8 +- .../V1}/Requests/Album/DeleteTrackRequest.php | 10 +- .../Album/GetAlbumPositionDataRequest.php | 8 +- .../V1}/Requests/Album/GetAlbumRequest.php | 8 +- .../V1}/Requests/Album/MergeAlbumsRequest.php | 14 +- .../V1}/Requests/Album/MoveAlbumsRequest.php | 14 +- .../Album/SetAlbumCopyrightRequest.php | 42 ++++ .../Requests/Album/SetAlbumCoverRequest.php | 12 +- .../Album/SetAlbumDescriptionRequest.php | 42 ++++ .../Requests/Album/SetAlbumHeaderRequest.php | 12 +- .../Requests/Album/SetAlbumLicenseRequest.php | 22 +- .../Requests/Album/SetAlbumNSFWRequest.php | 17 +- .../Album/SetAlbumProtectionPolicyRequest.php | 27 ++- .../Requests/Album/SetAlbumSortingRequest.php | 26 ++- .../Requests/Album/SetAlbumTagsRequest.php | 14 +- .../Requests/Album/SetAlbumTrackRequest.php | 10 +- .../Requests/Album/SetAlbumsTitleRequest.php | 12 +- .../V1}/Requests/Album/UnlockAlbumRequest.php | 12 +- .../Import/CancelImportServerRequest.php | 2 +- .../Requests/Import/ImportFromUrlRequest.php | 10 +- .../Requests/Import/ImportServerRequest.php | 8 +- .../V1}/Requests/Logs/ShowJobsRequest.php | 2 +- .../V1}/Requests/Photo/AddPhotoRequest.php | 10 +- .../Requests/Photo/ArchivePhotosRequest.php | 12 +- .../Requests/Photo/ClearSymLinkRequest.php | 2 +- .../Requests/Photo/DeletePhotosRequest.php | 8 +- .../Requests/Photo/DuplicatePhotosRequest.php | 14 +- .../V1}/Requests/Photo/GetPhotoRequest.php | 8 +- .../V1}/Requests/Photo/MovePhotosRequest.php | 14 +- .../V1}/Requests/Photo/RotatePhotoRequest.php | 10 +- .../Photo/SetPhotoDescriptionRequest.php | 14 +- .../Requests/Photo/SetPhotoLicenseRequest.php | 14 +- .../Photo/SetPhotoUploadDateRequest.php | 14 +- .../Photo/SetPhotosStarredRequest.php | 10 +- .../Requests/Photo/SetPhotosTagsRequest.php | 14 +- .../Requests/Photo/SetPhotosTitleRequest.php | 14 +- .../V1}/Requests/Search/SearchRequest.php | 2 +- .../Settings/AbstractSettingRequest.php | 2 +- .../Settings/GetSetAllSettingsRequest.php | 2 +- .../V1}/Requests/Settings/MigrateRequest.php | 12 +- .../V1}/Requests/Settings/OptimizeRequest.php | 2 +- .../Settings/SetAlbumDecorationRequest.php | 4 +- .../Settings/SetCSSSettingRequest.php | 2 +- .../SetDefaultLicenseSettingRequest.php | 2 +- .../Settings/SetDropboxKeySettingRequest.php | 2 +- .../SetImageOverlaySettingRequest.php | 2 +- .../Requests/Settings/SetJSSettingRequest.php | 2 +- .../Settings/SetLangSettingRequest.php | 2 +- .../Settings/SetLayoutSettingRequest.php | 2 +- .../SetLocationDecodingSettingRequest.php | 2 +- .../SetLocationShowPublicSettingRequest.php | 2 +- .../SetLocationShowSettingRequest.php | 2 +- .../SetMapDisplayPublicSettingRequest.php | 2 +- .../Settings/SetMapDisplaySettingRequest.php | 2 +- .../SetMapIncludeSubAlbumsSettingRequest.php | 2 +- .../Settings/SetMapProviderSettingRequest.php | 2 +- .../Settings/SetNSFWVisibilityRequest.php | 2 +- ...SetNewPhotosNotificationSettingRequest.php | 2 +- .../SetPublicSearchSettingRequest.php | 2 +- .../SetSmartAlbumVisibilityRequest.php | 12 +- .../Settings/SetSortingSettingsRequest.php | 2 +- .../V1}/Requests/Settings/UpdateRequest.php | 2 +- .../V1}/Requests/Sharing/AddSharesRequest.php | 12 +- .../Requests/Sharing/DeleteSharingRequest.php | 2 +- .../Requests/Sharing/ListSharingRequest.php | 8 +- .../Sharing/SetSharesByAlbumRequest.php | 12 +- .../AuthorizeCanEditAlbumAlbumsTrait.php | 2 +- .../Authorize/AuthorizeCanEditAlbumTrait.php | 2 +- .../Authorize/AuthorizeCanEditPhotoTrait.php | 2 +- .../AuthorizeCanEditPhotosAlbumTrait.php | 2 +- .../Authorize/AuthorizeCanEditPhotosTrait.php | 2 +- .../Requests/Traits/HasAbstractAlbumTrait.php | 2 +- .../V1}/Requests/Traits/HasAlbumIDTrait.php | 2 +- .../V1}/Requests/Traits/HasAlbumIDsTrait.php | 2 +- .../Traits/HasAlbumSortingCriterionTrait.php | 18 ++ .../V1}/Requests/Traits/HasAlbumTrait.php | 2 +- .../V1}/Requests/Traits/HasAlbumsTrait.php | 2 +- .../Requests/Traits/HasAspectRatioTrait.php | 18 ++ .../V1}/Requests/Traits/HasBaseAlbumTrait.php | 2 +- .../V1}/Requests/Traits/HasCopyrightTrait.php | 2 +- .../V1}/Requests/Traits/HasDateTrait.php | 2 +- .../Requests/Traits/HasDescriptionTrait.php | 2 +- .../V1}/Requests/Traits/HasIsPublicTrait.php | 2 +- .../V1}/Requests/Traits/HasLicenseTrait.php | 2 +- .../Requests/Traits/HasOptionalUserTrait.php | 2 +- .../Requests/Traits/HasParentAlbumTrait.php | 2 +- .../V1}/Requests/Traits/HasPasswordTrait.php | 2 +- .../V1}/Requests/Traits/HasPhotoIDTrait.php | 2 +- .../V1}/Requests/Traits/HasPhotoIDsTrait.php | 2 +- .../Traits/HasPhotoSortingCriterionTrait.php | 18 ++ .../V1}/Requests/Traits/HasPhotoTrait.php | 2 +- .../V1}/Requests/Traits/HasPhotosTrait.php | 2 +- .../Requests/Traits/HasSizeVariantTrait.php | 2 +- .../Traits/HasSortingCriterionTrait.php | 2 +- .../V1}/Requests/Traits/HasTagAlbumTrait.php | 2 +- .../V1}/Requests/Traits/HasTagsTrait.php | 2 +- .../V1}/Requests/Traits/HasTitleTrait.php | 2 +- .../V1}/Requests/Traits/HasUserIDTrait.php | 2 +- .../V1}/Requests/Traits/HasUserIDsTrait.php | 2 +- .../V1}/Requests/Traits/HasUserTrait.php | 2 +- .../V1}/Requests/Traits/HasUsernameTrait.php | 2 +- .../V1}/Requests/User/ChangeLoginRequest.php | 8 +- .../V1}/Requests/User/ChangeTokenRequest.php | 2 +- .../V1}/Requests/User/SetEmailRequest.php | 4 +- .../V1}/Requests/User/U2FRequest.php | 2 +- .../V1}/Requests/Users/AddUserRequest.php | 12 +- .../V1}/Requests/Users/DeleteUserRequest.php | 8 +- .../V1}/Requests/Users/ListUsersRequest.php | 2 +- .../Requests/Users/SetUserSettingsRequest.php | 16 +- .../V1}/Requests/View/GetPhotoViewRequest.php | 6 +- .../Collections/AlbumCollectionResource.php | 4 +- .../Collections/AlbumForestResource.php | 4 +- .../Collections/PhotoCollectionResource.php | 4 +- .../Collections/PositionDataResource.php | 4 +- .../Collections/TopAlbumsResource.php | 8 +- .../V1}/Resources/ConfigurationResource.php | 2 +- .../V1}/Resources/InitResource.php | 6 +- .../V1}/Resources/Models/AlbumResource.php | 10 +- .../Resources/Models/AlbumTreeResource.php | 2 +- .../V1}/Resources/Models/PhotoResource.php | 6 +- .../Resources/Models/SizeVariantResource.php | 2 +- .../Resources/Models/SmartAlbumResource.php | 6 +- .../V1}/Resources/Models/TagAlbumResource.php | 8 +- .../Models/UserManagementResource.php | 4 +- .../V1}/Resources/Models/UserResource.php | 4 +- .../Resources/Rights/AlbumRightsResource.php | 2 +- .../Resources/Rights/GlobalRightsResource.php | 2 +- .../Resources/Rights/PhotoRightsResource.php | 2 +- .../Rights/RootAlbumRightsResource.php | 2 +- .../Rights/SettingsRightsResource.php | 2 +- .../Rights/UserManagementRightsResource.php | 2 +- .../Resources/Rights/UserRightsResource.php | 2 +- .../V1}/Resources/SearchResource.php | 8 +- .../Sharing/ListedAlbumsResource.php | 2 +- .../Resources/Sharing/SharedAlbumResource.php | 2 +- .../V1}/Resources/Sharing/SharesResource.php | 2 +- .../Resources/Sharing/UserSharedResource.php | 2 +- .../V1}/Resources/Traits/WithStatus.php | 2 +- .../Album/SetAlbumProtectionPolicyRuleSet.php | 4 +- .../Components/Forms/Album/AddTrack.php | 2 +- .../Components/Forms/Album/Properties.php | 2 +- .../Components/Forms/Album/Visibility.php | 4 +- .../Components/Pages/Gallery/Albums.php | 6 +- .../Pages/Gallery/BaseAlbumComponent.php | 2 +- app/Livewire/Forms/ImportFromUrlForm.php | 2 +- app/Livewire/Forms/PhotoUpdateForm.php | 2 +- app/Livewire/Traits/UsePhotoViewActions.php | 2 +- .../Components/Gallery/Photo/Download.php | 2 +- app/View/Components/Meta.php | 2 +- config/feed.php | 2 +- phpunit.xml | 22 +- routes/api.php | 92 ++++---- routes/web-admin.php | 6 +- routes/web-livewire.php | 2 +- routes/web.php | 8 +- tests/AbstractTestCase.php | 4 +- .../{Feature => }/Constants/TestConstants.php | 2 +- tests/{Feature => Feature_v1}/AlbumTest.php | 22 +- .../{Feature => Feature_v1}/ApiTokenTest.php | 6 +- .../Base/BasePhotoTest.php | 12 +- .../Base/BasePhotosRotateTest.php | 4 +- .../Base/BaseSharingTest.php | 16 +- .../Base/BaseSharingTestScenarios.php | 12 +- .../Base/BaseSharingWithNonAdminUser.php | 4 +- .../BasePhotosAddHandler.php | 6 +- .../CommandFixPermissionsTest.php | 4 +- .../CommandGenerateThumbsTest.php | 6 +- .../CommandGhostbusterTest.php | 4 +- .../CommandTakeDateTest.php | 6 +- .../CommandVideoDataTest.php | 6 +- .../{Feature => Feature_v1}/CommandsTest.php | 2 +- .../DiagnosticsTest.php | 2 +- tests/{Feature => Feature_v1}/GeoDataTest.php | 20 +- .../{Feature => Feature_v1}/GitRemoteTest.php | 2 +- .../HelpersUnitTest.php | 2 +- .../{Feature => Feature_v1}/HoneyPotTest.php | 2 +- tests/{Feature => Feature_v1}/IndexTest.php | 19 +- tests/{Feature => Feature_v1}/InstallTest.php | 19 +- tests/{Feature => Feature_v1}/LangTest.php | 7 +- tests/{Feature => Feature_v1}/LegacyTest.php | 14 +- .../LibUnitTests/AlbumsUnitTest.php | 4 +- .../LibUnitTests/AssertableZipArchive.php | 2 +- .../LibUnitTests/PhotosUnitTest.php | 4 +- .../LibUnitTests/RootAlbumUnitTest.php | 4 +- .../LibUnitTests/SessionUnitTest.php | 4 +- .../LibUnitTests/SharingUnitTest.php | 4 +- .../LibUnitTests/UsersUnitTest.php | 4 +- tests/{Feature => Feature_v1}/LogsTest.php | 4 +- .../NotificationTest.php | 16 +- .../{Feature => Feature_v1}/OptimizeTest.php | 4 +- .../PhotosAddHandlerGDTest.php | 8 +- .../PhotosAddHandlerImagickTest.php | 8 +- .../PhotosAddMethodsTest.php | 6 +- .../PhotosAddNegativeTest.php | 10 +- .../PhotosAddSpecialAlbumTest.php | 8 +- .../PhotosDownloadTest.php | 14 +- .../PhotosOperationsTest.php | 18 +- .../PhotosRotateGDTest.php | 6 +- .../PhotosRotateImagickTest.php | 6 +- tests/{Feature => Feature_v1}/RSSTest.php | 10 +- .../{Feature => Feature_v1}/RedirectTest.php | 8 +- tests/{Feature => Feature_v1}/RootTest.php | 2 +- tests/{Feature => Feature_v1}/SearchTest.php | 14 +- .../{Feature => Feature_v1}/SettingsTest.php | 4 +- .../SharingBasicTest.php | 6 +- .../SharingSpecialTest.php | 6 +- .../SharingWithAnonUserTest.php | 6 +- .../SharingWithNonAdminUserTest.php | 6 +- .../SmartAlbumVisibilityTest.php | 20 +- tests/{Feature => Feature_v1}/UpdateTest.php | 4 +- tests/{Feature => Feature_v1}/UsersTest.php | 10 +- .../VersionDTOUnitTest.php | 2 +- tests/{Feature => Feature_v1}/WebAuthTest.php | 6 +- tests/Livewire/Base/BaseLivewireTest.php | 6 +- tests/Livewire/Forms/FormsProfileTest.php | 2 +- .../Livewire/Forms/ImportFromDropBoxTest.php | 2 +- tests/Livewire/Forms/ImportFromUrlTest.php | 2 +- tests/Livewire/Forms/UploadTest.php | 2 +- tests/Livewire/Pages/SettingsTest.php | 2 +- tests/Livewire/Pages/UsersTest.php | 2 +- tests/{Feature => }/Traits/CatchFailures.php | 2 +- .../Traits/InteractWithSmartAlbums.php | 2 +- .../InteractsWithFilesystemPermissions.php | 2 +- .../{Feature => }/Traits/InteractsWithRaw.php | 4 +- .../Traits/RequiresEmptyAlbums.php | 2 +- .../Traits/RequiresEmptyPhotos.php | 2 +- .../Traits/RequiresEmptyUsers.php | 2 +- .../RequiresEmptyWebAuthnCredentials.php | 2 +- .../{Feature => }/Traits/RequiresExifTool.php | 4 +- tests/{Feature => }/Traits/RequiresFFMpeg.php | 4 +- .../Traits/RequiresImageHandler.php | 4 +- 347 files changed, 1438 insertions(+), 1225 deletions(-) rename .github/workflows/{.env.mariadb => .env.legacy.mariadb} (93%) rename .github/workflows/{.env.postgresql => .env.legacy.postgresql} (92%) rename .github/workflows/{.env.sqlite => .env.legacy.sqlite} (90%) create mode 100644 .github/workflows/js_check.yml create mode 100644 .github/workflows/php_dist.yml create mode 100644 .github/workflows/php_tests.yml create mode 100644 app/DTO/TopAlbumDTO.php delete mode 100644 app/Http/Middleware/RedirectLegacyPhotoID.php delete mode 100644 app/Http/Requests/Album/SetAlbumCopyrightRequest.php delete mode 100644 app/Http/Requests/Album/SetAlbumDescriptionRequest.php delete mode 100644 app/Http/RuleSets/Album/SetAlbumCopyrightRuleSet.php rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasAbstractAlbum.php (76%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasAlbum.php (74%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasAlbumID.php (67%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasAlbumIDs.php (67%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasAlbums.php (81%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasBaseAlbum.php (77%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasCopyright.php (68%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasDate.php (73%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasDescription.php (69%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasIsPublic.php (66%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasLicense.php (74%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasOptionalUser.php (91%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasParentAlbum.php (73%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasPassword.php (68%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasPhoto.php (71%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasPhotoID.php (67%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasPhotoIDs.php (67%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasPhotos.php (78%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasSizeVariant.php (77%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasSortingCriterion.php (79%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasTagAlbum.php (75%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasTags.php (65%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasTitle.php (67%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasUser.php (76%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasUserID.php (64%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasUserIDs.php (66%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/HasUsername.php (67%) rename app/{ => Legacy/V1}/Contracts/Http/Requests/RequestAttribute.php (98%) rename app/{Http => Legacy/V1}/Controllers/Administration/DiagnosticsController.php (98%) rename app/{Http => Legacy/V1}/Controllers/Administration/JobController.php (90%) rename app/{Http => Legacy/V1}/Controllers/Administration/OptimizeController.php (88%) rename app/{Http => Legacy/V1}/Controllers/Administration/SettingsController.php (87%) rename app/{Http => Legacy/V1}/Controllers/Administration/SharingController.php (90%) rename app/{Http => Legacy/V1}/Controllers/Administration/UpdateController.php (96%) rename app/{Http => Legacy/V1}/Controllers/Administration/UserController.php (91%) rename app/{Http => Legacy/V1}/Controllers/Administration/UsersController.php (88%) rename app/{Http => Legacy/V1}/Controllers/AlbumController.php (85%) rename app/{Http => Legacy/V1}/Controllers/AlbumsController.php (66%) rename app/{Http => Legacy/V1}/Controllers/ImportController.php (92%) rename app/{Http => Legacy/V1}/Controllers/IndexController.php (98%) rename app/{Http => Legacy/V1}/Controllers/LegacyController.php (97%) rename app/{Http => Legacy/V1}/Controllers/PhotoController.php (91%) rename app/{Http => Legacy/V1}/Controllers/PhotoEditorController.php (85%) rename app/{Http => Legacy/V1}/Controllers/RSSController.php (94%) rename app/{Http => Legacy/V1}/Controllers/RedirectController.php (98%) rename app/{Http => Legacy/V1}/Controllers/SearchController.php (87%) rename app/{Http => Legacy/V1}/Controllers/SessionController.php (96%) create mode 100644 app/Legacy/V1/Middleware/LoginRequiredV1.php rename app/{Http => Legacy/V1}/Requests/Album/AddAlbumRequest.php (75%) rename app/{Http => Legacy/V1}/Requests/Album/AddTagAlbumRequest.php (75%) rename app/{Http => Legacy/V1}/Requests/Album/ArchiveAlbumsRequest.php (76%) rename app/{Http => Legacy/V1}/Requests/Album/DeleteAlbumsRequest.php (81%) rename app/{Http => Legacy/V1}/Requests/Album/DeleteTrackRequest.php (68%) rename app/{Http => Legacy/V1}/Requests/Album/GetAlbumPositionDataRequest.php (86%) rename app/{Http => Legacy/V1}/Requests/Album/GetAlbumRequest.php (85%) rename app/{Http => Legacy/V1}/Requests/Album/MergeAlbumsRequest.php (70%) rename app/{Http => Legacy/V1}/Requests/Album/MoveAlbumsRequest.php (70%) create mode 100644 app/Legacy/V1/Requests/Album/SetAlbumCopyrightRequest.php rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumCoverRequest.php (79%) create mode 100644 app/Legacy/V1/Requests/Album/SetAlbumDescriptionRequest.php rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumHeaderRequest.php (79%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumLicenseRequest.php (51%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumNSFWRequest.php (59%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumProtectionPolicyRequest.php (62%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumSortingRequest.php (52%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumTagsRequest.php (64%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumTrackRequest.php (76%) rename app/{Http => Legacy/V1}/Requests/Album/SetAlbumsTitleRequest.php (81%) rename app/{Http => Legacy/V1}/Requests/Album/UnlockAlbumRequest.php (69%) rename app/{Http => Legacy/V1}/Requests/Import/CancelImportServerRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Import/ImportFromUrlRequest.php (84%) rename app/{Http => Legacy/V1}/Requests/Import/ImportServerRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Logs/ShowJobsRequest.php (89%) rename app/{Http => Legacy/V1}/Requests/Photo/AddPhotoRequest.php (80%) rename app/{Http => Legacy/V1}/Requests/Photo/ArchivePhotosRequest.php (85%) rename app/{Http => Legacy/V1}/Requests/Photo/ClearSymLinkRequest.php (87%) rename app/{Http => Legacy/V1}/Requests/Photo/DeletePhotosRequest.php (81%) rename app/{Http => Legacy/V1}/Requests/Photo/DuplicatePhotosRequest.php (70%) rename app/{Http => Legacy/V1}/Requests/Photo/GetPhotoRequest.php (80%) rename app/{Http => Legacy/V1}/Requests/Photo/MovePhotosRequest.php (69%) rename app/{Http => Legacy/V1}/Requests/Photo/RotatePhotoRequest.php (74%) rename app/{Http => Legacy/V1}/Requests/Photo/SetPhotoDescriptionRequest.php (65%) rename app/{Http => Legacy/V1}/Requests/Photo/SetPhotoLicenseRequest.php (66%) rename app/{Http => Legacy/V1}/Requests/Photo/SetPhotoUploadDateRequest.php (67%) rename app/{Http => Legacy/V1}/Requests/Photo/SetPhotosStarredRequest.php (77%) rename app/{Http => Legacy/V1}/Requests/Photo/SetPhotosTagsRequest.php (68%) rename app/{Http => Legacy/V1}/Requests/Photo/SetPhotosTitleRequest.php (65%) rename app/{Http => Legacy/V1}/Requests/Search/SearchRequest.php (95%) rename app/{Http => Legacy/V1}/Requests/Settings/AbstractSettingRequest.php (93%) rename app/{Http => Legacy/V1}/Requests/Settings/GetSetAllSettingsRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/MigrateRequest.php (87%) rename app/{Http => Legacy/V1}/Requests/Settings/OptimizeRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetAlbumDecorationRequest.php (93%) rename app/{Http => Legacy/V1}/Requests/Settings/SetCSSSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetDefaultLicenseSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetDropboxKeySettingRequest.php (87%) rename app/{Http => Legacy/V1}/Requests/Settings/SetImageOverlaySettingRequest.php (92%) rename app/{Http => Legacy/V1}/Requests/Settings/SetJSSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetLangSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetLayoutSettingRequest.php (91%) rename app/{Http => Legacy/V1}/Requests/Settings/SetLocationDecodingSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetLocationShowPublicSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetLocationShowSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetMapDisplayPublicSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetMapDisplaySettingRequest.php (89%) rename app/{Http => Legacy/V1}/Requests/Settings/SetMapIncludeSubAlbumsSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetMapProviderSettingRequest.php (91%) rename app/{Http => Legacy/V1}/Requests/Settings/SetNSFWVisibilityRequest.php (89%) rename app/{Http => Legacy/V1}/Requests/Settings/SetNewPhotosNotificationSettingRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Settings/SetPublicSearchSettingRequest.php (92%) rename app/{Http => Legacy/V1}/Requests/Settings/SetSmartAlbumVisibilityRequest.php (78%) rename app/{Http => Legacy/V1}/Requests/Settings/SetSortingSettingsRequest.php (98%) rename app/{Http => Legacy/V1}/Requests/Settings/UpdateRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Sharing/AddSharesRequest.php (78%) rename app/{Http => Legacy/V1}/Requests/Sharing/DeleteSharingRequest.php (95%) rename app/{Http => Legacy/V1}/Requests/Sharing/ListSharingRequest.php (93%) rename app/{Http => Legacy/V1}/Requests/Sharing/SetSharesByAlbumRequest.php (79%) rename app/{Http => Legacy/V1}/Requests/Traits/Authorize/AuthorizeCanEditAlbumAlbumsTrait.php (90%) rename app/{Http => Legacy/V1}/Requests/Traits/Authorize/AuthorizeCanEditAlbumTrait.php (88%) rename app/{Http => Legacy/V1}/Requests/Traits/Authorize/AuthorizeCanEditPhotoTrait.php (88%) rename app/{Http => Legacy/V1}/Requests/Traits/Authorize/AuthorizeCanEditPhotosAlbumTrait.php (92%) rename app/{Http => Legacy/V1}/Requests/Traits/Authorize/AuthorizeCanEditPhotosTrait.php (89%) rename app/{Http => Legacy/V1}/Requests/Traits/HasAbstractAlbumTrait.php (85%) rename app/{Http => Legacy/V1}/Requests/Traits/HasAlbumIDTrait.php (80%) rename app/{Http => Legacy/V1}/Requests/Traits/HasAlbumIDsTrait.php (82%) create mode 100644 app/Legacy/V1/Requests/Traits/HasAlbumSortingCriterionTrait.php rename app/{Http => Legacy/V1}/Requests/Traits/HasAlbumTrait.php (81%) rename app/{Http => Legacy/V1}/Requests/Traits/HasAlbumsTrait.php (88%) create mode 100644 app/Legacy/V1/Requests/Traits/HasAspectRatioTrait.php rename app/{Http => Legacy/V1}/Requests/Traits/HasBaseAlbumTrait.php (83%) rename app/{Http => Legacy/V1}/Requests/Traits/HasCopyrightTrait.php (81%) rename app/{Http => Legacy/V1}/Requests/Traits/HasDateTrait.php (82%) rename app/{Http => Legacy/V1}/Requests/Traits/HasDescriptionTrait.php (82%) rename app/{Http => Legacy/V1}/Requests/Traits/HasIsPublicTrait.php (80%) rename app/{Http => Legacy/V1}/Requests/Traits/HasLicenseTrait.php (84%) rename app/{Http => Legacy/V1}/Requests/Traits/HasOptionalUserTrait.php (93%) rename app/{Http => Legacy/V1}/Requests/Traits/HasParentAlbumTrait.php (83%) rename app/{Http => Legacy/V1}/Requests/Traits/HasPasswordTrait.php (95%) rename app/{Http => Legacy/V1}/Requests/Traits/HasPhotoIDTrait.php (80%) rename app/{Http => Legacy/V1}/Requests/Traits/HasPhotoIDsTrait.php (82%) create mode 100644 app/Legacy/V1/Requests/Traits/HasPhotoSortingCriterionTrait.php rename app/{Http => Legacy/V1}/Requests/Traits/HasPhotoTrait.php (81%) rename app/{Http => Legacy/V1}/Requests/Traits/HasPhotosTrait.php (87%) rename app/{Http => Legacy/V1}/Requests/Traits/HasSizeVariantTrait.php (85%) rename app/{Http => Legacy/V1}/Requests/Traits/HasSortingCriterionTrait.php (87%) rename app/{Http => Legacy/V1}/Requests/Traits/HasTagAlbumTrait.php (82%) rename app/{Http => Legacy/V1}/Requests/Traits/HasTagsTrait.php (81%) rename app/{Http => Legacy/V1}/Requests/Traits/HasTitleTrait.php (80%) rename app/{Http => Legacy/V1}/Requests/Traits/HasUserIDTrait.php (80%) rename app/{Http => Legacy/V1}/Requests/Traits/HasUserIDsTrait.php (82%) rename app/{Http => Legacy/V1}/Requests/Traits/HasUserTrait.php (93%) rename app/{Http => Legacy/V1}/Requests/Traits/HasUsernameTrait.php (79%) rename app/{Http => Legacy/V1}/Requests/User/ChangeLoginRequest.php (89%) rename app/{Http => Legacy/V1}/Requests/User/ChangeTokenRequest.php (89%) rename app/{Http => Legacy/V1}/Requests/User/SetEmailRequest.php (87%) rename app/{Http => Legacy/V1}/Requests/User/U2FRequest.php (90%) rename app/{Http => Legacy/V1}/Requests/Users/AddUserRequest.php (79%) rename app/{Http => Legacy/V1}/Requests/Users/DeleteUserRequest.php (80%) rename app/{Http => Legacy/V1}/Requests/Users/ListUsersRequest.php (89%) rename app/{Http => Legacy/V1}/Requests/Users/SetUserSettingsRequest.php (80%) rename app/{Http => Legacy/V1}/Requests/View/GetPhotoViewRequest.php (86%) rename app/{Http => Legacy/V1}/Resources/Collections/AlbumCollectionResource.php (75%) rename app/{Http => Legacy/V1}/Resources/Collections/AlbumForestResource.php (91%) rename app/{Http => Legacy/V1}/Resources/Collections/PhotoCollectionResource.php (94%) rename app/{Http => Legacy/V1}/Resources/Collections/PositionDataResource.php (93%) rename app/{Http => Legacy/V1}/Resources/Collections/TopAlbumsResource.php (89%) rename app/{Http => Legacy/V1}/Resources/ConfigurationResource.php (99%) rename app/{Http => Legacy/V1}/Resources/InitResource.php (89%) rename app/{Http => Legacy/V1}/Resources/Models/AlbumResource.php (87%) rename app/{Http => Legacy/V1}/Resources/Models/AlbumTreeResource.php (95%) rename app/{Http => Legacy/V1}/Resources/Models/PhotoResource.php (97%) rename app/{Http => Legacy/V1}/Resources/Models/SizeVariantResource.php (96%) rename app/{Http => Legacy/V1}/Resources/Models/SmartAlbumResource.php (89%) rename app/{Http => Legacy/V1}/Resources/Models/TagAlbumResource.php (87%) rename app/{Http => Legacy/V1}/Resources/Models/UserManagementResource.php (91%) rename app/{Http => Legacy/V1}/Resources/Models/UserResource.php (90%) rename app/{Http => Legacy/V1}/Resources/Rights/AlbumRightsResource.php (97%) rename app/{Http => Legacy/V1}/Resources/Rights/GlobalRightsResource.php (95%) rename app/{Http => Legacy/V1}/Resources/Rights/PhotoRightsResource.php (97%) rename app/{Http => Legacy/V1}/Resources/Rights/RootAlbumRightsResource.php (96%) rename app/{Http => Legacy/V1}/Resources/Rights/SettingsRightsResource.php (96%) rename app/{Http => Legacy/V1}/Resources/Rights/UserManagementRightsResource.php (96%) rename app/{Http => Legacy/V1}/Resources/Rights/UserRightsResource.php (94%) rename app/{Http => Legacy/V1}/Resources/SearchResource.php (91%) rename app/{Http => Legacy/V1}/Resources/Sharing/ListedAlbumsResource.php (93%) rename app/{Http => Legacy/V1}/Resources/Sharing/SharedAlbumResource.php (94%) rename app/{Http => Legacy/V1}/Resources/Sharing/SharesResource.php (96%) rename app/{Http => Legacy/V1}/Resources/Sharing/UserSharedResource.php (92%) rename app/{Http => Legacy/V1}/Resources/Traits/WithStatus.php (92%) rename app/{Http => Legacy/V1}/RuleSets/Album/SetAlbumProtectionPolicyRuleSet.php (89%) rename tests/{Feature => }/Constants/TestConstants.php (99%) rename tests/{Feature => Feature_v1}/AlbumTest.php (98%) rename tests/{Feature => Feature_v1}/ApiTokenTest.php (98%) rename tests/{Feature => Feature_v1}/Base/BasePhotoTest.php (81%) rename tests/{Feature => Feature_v1}/Base/BasePhotosRotateTest.php (98%) rename tests/{Feature => Feature_v1}/Base/BaseSharingTest.php (94%) rename tests/{Feature => Feature_v1}/Base/BaseSharingTestScenarios.php (99%) rename tests/{Feature => Feature_v1}/Base/BaseSharingWithNonAdminUser.php (99%) rename tests/{Feature => Feature_v1}/BasePhotosAddHandler.php (99%) rename tests/{Feature => Feature_v1}/CommandFixPermissionsTest.php (96%) rename tests/{Feature => Feature_v1}/CommandGenerateThumbsTest.php (95%) rename tests/{Feature => Feature_v1}/CommandGhostbusterTest.php (98%) rename tests/{Feature => Feature_v1}/CommandTakeDateTest.php (93%) rename tests/{Feature => Feature_v1}/CommandVideoDataTest.php (93%) rename tests/{Feature => Feature_v1}/CommandsTest.php (96%) rename tests/{Feature => Feature_v1}/DiagnosticsTest.php (97%) rename tests/{Feature => Feature_v1}/GeoDataTest.php (95%) rename tests/{Feature => Feature_v1}/GitRemoteTest.php (98%) rename tests/{Feature => Feature_v1}/HelpersUnitTest.php (97%) rename tests/{Feature => Feature_v1}/HoneyPotTest.php (98%) rename tests/{Feature => Feature_v1}/IndexTest.php (81%) rename tests/{Feature => Feature_v1}/InstallTest.php (92%) rename tests/{Feature => Feature_v1}/LangTest.php (91%) rename tests/{Feature => Feature_v1}/LegacyTest.php (86%) rename tests/{Feature => Feature_v1}/LibUnitTests/AlbumsUnitTest.php (99%) rename tests/{Feature => Feature_v1}/LibUnitTests/AssertableZipArchive.php (98%) rename tests/{Feature => Feature_v1}/LibUnitTests/PhotosUnitTest.php (99%) rename tests/{Feature => Feature_v1}/LibUnitTests/RootAlbumUnitTest.php (96%) rename tests/{Feature => Feature_v1}/LibUnitTests/SessionUnitTest.php (97%) rename tests/{Feature => Feature_v1}/LibUnitTests/SharingUnitTest.php (95%) rename tests/{Feature => Feature_v1}/LibUnitTests/UsersUnitTest.php (98%) rename tests/{Feature => Feature_v1}/LogsTest.php (95%) rename tests/{Feature => Feature_v1}/NotificationTest.php (90%) rename tests/{Feature => Feature_v1}/OptimizeTest.php (92%) rename tests/{Feature => Feature_v1}/PhotosAddHandlerGDTest.php (90%) rename tests/{Feature => Feature_v1}/PhotosAddHandlerImagickTest.php (90%) rename tests/{Feature => Feature_v1}/PhotosAddMethodsTest.php (99%) rename tests/{Feature => Feature_v1}/PhotosAddNegativeTest.php (95%) rename tests/{Feature => Feature_v1}/PhotosAddSpecialAlbumTest.php (94%) rename tests/{Feature => Feature_v1}/PhotosDownloadTest.php (97%) rename tests/{Feature => Feature_v1}/PhotosOperationsTest.php (97%) rename tests/{Feature => Feature_v1}/PhotosRotateGDTest.php (85%) rename tests/{Feature => Feature_v1}/PhotosRotateImagickTest.php (85%) rename tests/{Feature => Feature_v1}/RSSTest.php (92%) rename tests/{Feature => Feature_v1}/RedirectTest.php (78%) rename tests/{Feature => Feature_v1}/RootTest.php (96%) rename tests/{Feature => Feature_v1}/SearchTest.php (97%) rename tests/{Feature => Feature_v1}/SettingsTest.php (99%) rename tests/{Feature => Feature_v1}/SharingBasicTest.php (95%) rename tests/{Feature => Feature_v1}/SharingSpecialTest.php (99%) rename tests/{Feature => Feature_v1}/SharingWithAnonUserTest.php (99%) rename tests/{Feature => Feature_v1}/SharingWithNonAdminUserTest.php (99%) rename tests/{Feature => Feature_v1}/SmartAlbumVisibilityTest.php (93%) rename tests/{Feature => Feature_v1}/UpdateTest.php (98%) rename tests/{Feature => Feature_v1}/UsersTest.php (97%) rename tests/{Feature => Feature_v1}/VersionDTOUnitTest.php (97%) rename tests/{Feature => Feature_v1}/WebAuthTest.php (99%) rename tests/{Feature => }/Traits/CatchFailures.php (98%) rename tests/{Feature => }/Traits/InteractWithSmartAlbums.php (97%) rename tests/{Feature => }/Traits/InteractsWithFilesystemPermissions.php (95%) rename tests/{Feature => }/Traits/InteractsWithRaw.php (87%) rename tests/{Feature => }/Traits/RequiresEmptyAlbums.php (98%) rename tests/{Feature => }/Traits/RequiresEmptyPhotos.php (98%) rename tests/{Feature => }/Traits/RequiresEmptyUsers.php (96%) rename tests/{Feature => }/Traits/RequiresEmptyWebAuthnCredentials.php (96%) rename tests/{Feature => }/Traits/RequiresExifTool.php (93%) rename tests/{Feature => }/Traits/RequiresFFMpeg.php (93%) rename tests/{Feature => }/Traits/RequiresImageHandler.php (94%) diff --git a/.github/workflows/.env.mariadb b/.github/workflows/.env.legacy.mariadb similarity index 93% rename from .github/workflows/.env.mariadb rename to .github/workflows/.env.legacy.mariadb index d55c6b6dae6..d0f5caa9912 100644 --- a/.github/workflows/.env.mariadb +++ b/.github/workflows/.env.legacy.mariadb @@ -4,6 +4,7 @@ APP_ENV=dev APP_KEY=SomeRandomString APP_DEBUG=true LIVEWIRE_ENABLED=false +LEGACY_API_ENABLED=true DB_CONNECTION=mysql DB_HOST=localhost diff --git a/.github/workflows/.env.postgresql b/.github/workflows/.env.legacy.postgresql similarity index 92% rename from .github/workflows/.env.postgresql rename to .github/workflows/.env.legacy.postgresql index 57702d51d0c..3fd71d2c2bd 100644 --- a/.github/workflows/.env.postgresql +++ b/.github/workflows/.env.legacy.postgresql @@ -4,6 +4,7 @@ APP_ENV=dev APP_KEY=SomeRandomString APP_DEBUG=true LIVEWIRE_ENABLED=false +LEGACY_API_ENABLED=true DB_CONNECTION=pgsql DB_HOST=localhost diff --git a/.github/workflows/.env.sqlite b/.github/workflows/.env.legacy.sqlite similarity index 90% rename from .github/workflows/.env.sqlite rename to .github/workflows/.env.legacy.sqlite index 676b77bfaff..d2cb2964594 100644 --- a/.github/workflows/.env.sqlite +++ b/.github/workflows/.env.legacy.sqlite @@ -4,6 +4,7 @@ APP_ENV=dev APP_KEY=SomeRandomString APP_DEBUG=true LIVEWIRE_ENABLED=false +LEGACY_API_ENABLED=true DB_CONNECTION=sqlite DB_LIST_FOREIGN_KEYS=true diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 2c77bcfe3c8..42fd14fd4d1 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -73,33 +73,10 @@ jobs: run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --verbose --diff --dry-run check_js: - name: 2️⃣ JS Node ${{ matrix.node-version }} - Code Style errors & Compilation - runs-on: ubuntu-latest + name: 2️⃣ JS front-end + uses: ./.github/workflows/js_check.yml needs: - php_syntax_errors - strategy: - matrix: - node-version: [18, 20] - steps: - - name: Checkout code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version: ${{ matrix.node-version }} - - - name: Install - run: npm install -D - - - name: Check Style - run: npm run check-formatting - - - name: Check TypeScript - run: npm run check - - - name: Compile Front-end - run: npm run build phpstan: name: 2️⃣ PHP 8.2 - PHPStan @@ -122,173 +99,22 @@ jobs: - name: Run PHPStan run: vendor/bin/phpstan analyze - tests: - name: 2️⃣ PHP ${{ matrix.php-version }} - ${{ matrix.sql-versions }} -- ${{ matrix.test-suite }} + tests_legacy: + name: 2️⃣ PHP tests legacy + uses: ./.github/workflows/php_tests.yml needs: - php_syntax_errors - runs-on: ubuntu-latest - strategy: - matrix: - php-version: - - 8.2 - - 8.3 - sql-versions: - - mariadb - - postgresql - - sqlite - test-suite: - - Feature - - Livewire - # Service containers to run with `container-job` - services: - # Label used to access the service container - postgres: - # Docker Hub image - image: postgres - # Provide the password for postgres - env: - POSTGRES_PASSWORD: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - env: - extensions: bcmath, curl, dom, gd, imagick, json, libxml, mbstring, pcntl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pgsql, sqlite3, zip - - steps: - - name: Checkout code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Set Up Imagick, FFmpeg & Exiftools - run: | - sudo apt-get update - sudo apt-get --fix-broken install - sudo apt-get -y install ffmpeg libimage-exiftool-perl - - - name: setup Databases - run: | - sudo service mysql start - touch database/database.sqlite - mysql -uroot -proot -e 'create database homestead_test;' - - - name: Setup PHP Action - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # 2.30.0 - with: - php-version: ${{ matrix.php-version }} - extensions: ${{ env.extensions }} - coverage: xdebug - tools: pecl, composer - - - name: Install Composer dependencies - uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0 - - - name: copy Env - run: | - cp .github/workflows/.env.${{ matrix.sql-versions }} .env - - - name: Generate secure key & Optimize application & Migrate - run: | - php artisan key:generate - php artisan optimize - php artisan migrate - - - name: Apply tests ${{ matrix.test-suite }} - run: XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite ${{ matrix.test-suite }} - - - name: Make sure we can go backward - run: php artisan migrate:rollback - - - name: Codecov - uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 - env: - token: ${{ secrets.CODECOV_TOKEN }} + with: + test-suite: 'Feature_v1' + env-file: '.env.legacy' dist: - name: 3️⃣ PHP ${{ matrix.php-version }} - ${{ matrix.sql-versions }} - Dist + name: 3️⃣ PHP dist needs: - code_style_errors - runs-on: ubuntu-latest - strategy: - matrix: - php-version: - - 8.2 - sql-versions: - - mariadb - - postgresql - - sqlite - # Service containers to run with `container-job` - services: - # Label used to access the service container - postgres: - # Docker Hub image - image: postgres - # Provide the password for postgres - env: - POSTGRES_PASSWORD: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - env: - extensions: bcmath, curl, dom, gd, imagick, json, libxml, mbstring, pcntl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pgsql, sqlite3, zip - - steps: - - name: Checkout code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Set Up Imagick, FFmpeg & Exiftools - run: | - sudo apt-get update - sudo apt-get --fix-broken install - sudo apt-get -y install ffmpeg libimage-exiftool-perl - - - name: setup Databases - run: | - sudo service mysql start - touch database/database.sqlite - mysql -uroot -proot -e 'create database homestead_test;' - - - name: Setup PHP Action - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # 2.30.0 - with: - php-version: ${{ matrix.php-version }} - extensions: ${{ env.extensions }} - tools: pecl, composer - - - name: Install Composer dependencies - uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0 - with: - composer-options: --no-dev - - - name: Build Dist - run: | - make dist-clean - - - name: copy Env - run: | - cp .github/workflows/.env.${{ matrix.sql-versions }} Lychee/.env - - - name: setup MySQL Database with v3 - run: | - mysql -uroot -proot homestead_test < .github/workflows/v3.sql - - - name: Generate secure key & Migrate & go backward - run: | - cd Lychee - pwd - php artisan key:generate - php artisan migrate - php artisan migrate:rollback + uses: ./.github/workflows/php_dist.yml + with: + env-file: '.env.legacy' createArtifact: name: 4️⃣ Build Artifact @@ -296,7 +122,8 @@ jobs: needs: - phpstan - dist - - tests + - tests_legacy + - check_js runs-on: ubuntu-latest env: extensions: bcmath, curl, dom, gd, imagick, json, libxml, mbstring, pcntl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pgsql, sqlite3, zip diff --git a/.github/workflows/js_check.yml b/.github/workflows/js_check.yml new file mode 100644 index 00000000000..a9cf2fb8fa0 --- /dev/null +++ b/.github/workflows/js_check.yml @@ -0,0 +1,32 @@ +name: Check JS + +on: + workflow_call: + +jobs: + check_js: + name: Node ${{ matrix.node-version }} + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20] + steps: + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node-version }} + + - name: Install + run: npm install -D + + - name: Check Style + run: npm run check-formatting + + - name: Check TypeScript + run: npm run check + + - name: Compile Front-end + run: npm run build diff --git a/.github/workflows/php_dist.yml b/.github/workflows/php_dist.yml new file mode 100644 index 00000000000..4d4367e902c --- /dev/null +++ b/.github/workflows/php_dist.yml @@ -0,0 +1,90 @@ +name: PHP Dist + +on: + workflow_call: + inputs: + env-file: + required: true + type: string + description: 'The env files to use' + +jobs: + php_dist: + name: ${{ matrix.php-version }} - ${{ matrix.sql-versions }} + runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - 8.2 + sql-versions: + - mariadb + - postgresql + - sqlite + # Service containers to run with `container-job` + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + env: + extensions: bcmath, curl, dom, gd, imagick, json, libxml, mbstring, pcntl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pgsql, sqlite3, zip + + steps: + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set Up Imagick, FFmpeg & Exiftools + run: | + sudo apt-get update + sudo apt-get --fix-broken install + sudo apt-get -y install ffmpeg libimage-exiftool-perl + + - name: setup Databases + run: | + sudo service mysql start + touch database/database.sqlite + mysql -uroot -proot -e 'create database homestead_test;' + + - name: Setup PHP Action + uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # 2.30.0 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + tools: pecl, composer + + - name: Install Composer dependencies + uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0 + with: + composer-options: --no-dev + + - name: Build Dist + run: | + make dist-clean + + - name: copy Env + run: | + cp .github/workflows/${{ inputs.env-file }}.${{ matrix.sql-versions }} Lychee/.env + + - name: setup MySQL Database with v3 + run: | + mysql -uroot -proot homestead_test < .github/workflows/v3.sql + + - name: Generate secure key & Migrate & go backward + run: | + cd Lychee + pwd + php artisan key:generate + php artisan migrate + php artisan migrate:rollback diff --git a/.github/workflows/php_tests.yml b/.github/workflows/php_tests.yml new file mode 100644 index 00000000000..c1c4d8cc401 --- /dev/null +++ b/.github/workflows/php_tests.yml @@ -0,0 +1,95 @@ +name: PHP Tests + +on: + workflow_call: + inputs: + test-suite: + required: true + type: string + description: 'The test suite to run' + env-file: + required: true + type: string + description: 'The env files to use' + +jobs: + tests: + name: ${{ matrix.php-version }} - ${{ matrix.sql-versions }} -- ${{ inputs.test-suite }} + runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - 8.2 + - 8.3 + sql-versions: + - mariadb + - postgresql + - sqlite + # Service containers to run with `container-job` + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + env: + extensions: bcmath, curl, dom, gd, imagick, json, libxml, mbstring, pcntl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pgsql, sqlite3, zip + + steps: + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set Up Imagick, FFmpeg & Exiftools + run: | + sudo apt-get update + sudo apt-get --fix-broken install + sudo apt-get -y install ffmpeg libimage-exiftool-perl + + - name: setup Databases + run: | + sudo service mysql start + touch database/database.sqlite + mysql -uroot -proot -e 'create database homestead_test;' + + - name: Setup PHP Action + uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # 2.30.0 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + coverage: xdebug + tools: pecl, composer + + - name: Install Composer dependencies + uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # 3.0.0 + + - name: copy Env + run: | + cp .github/workflows/${{ inputs.env-file }}.${{ matrix.sql-versions }} .env + + - name: Generate secure key & Optimize application & Migrate + run: | + php artisan key:generate + php artisan optimize + php artisan migrate + + - name: Apply tests ${{ inputs.test-suite }} + run: XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite ${{ inputs.test-suite }} + + - name: Make sure we can go backward + run: php artisan migrate:rollback + + - name: Codecov + uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 + env: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 4c6374b1f7d..503560bce34 100644 --- a/Makefile +++ b/Makefile @@ -123,7 +123,7 @@ release_major: gen_major # Building tests 1 by 1 -TESTS_PHP := $(shell find tests/Feature -name "*Test.php" -printf "%f\n") +TESTS_PHP := $(shell find tests/Feature_v1 -name "*Test.php" -printf "%f\n") TEST_DONE := $(addprefix build/,$(TESTS_PHP:.php=.done)) build: @@ -135,7 +135,7 @@ build/Base%.done: build/%UnitTest.done: touch build/$*UnitTest.done -build/%.done: tests/Feature/%.php build +build/%.done: tests/Feature_v1/%.php build vendor/bin/phpunit --no-coverage --filter $* && touch build/$*.done all_tests: $(TEST_DONE) \ No newline at end of file diff --git a/app/Actions/Album/PositionData.php b/app/Actions/Album/PositionData.php index 1c0c59db3f3..e9f347014d5 100644 --- a/app/Actions/Album/PositionData.php +++ b/app/Actions/Album/PositionData.php @@ -4,7 +4,7 @@ use App\Contracts\Models\AbstractAlbum; use App\Enum\SizeVariantType; -use App\Http\Resources\Collections\PositionDataResource; +use App\Legacy\V1\Resources\Collections\PositionDataResource; use App\Models\Album; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; diff --git a/app/Actions/Albums/PositionData.php b/app/Actions/Albums/PositionData.php index 9e0d0f9c45f..a28a11d2e07 100644 --- a/app/Actions/Albums/PositionData.php +++ b/app/Actions/Albums/PositionData.php @@ -4,7 +4,7 @@ use App\Contracts\Exceptions\InternalLycheeException; use App\Enum\SizeVariantType; -use App\Http\Resources\Collections\PositionDataResource; +use App\Legacy\V1\Resources\Collections\PositionDataResource; use App\Models\Configs; use App\Models\Photo; use App\Policies\PhotoQueryPolicy; diff --git a/app/Actions/Albums/Top.php b/app/Actions/Albums/Top.php index b06e4d9a757..56b66fa22f5 100644 --- a/app/Actions/Albums/Top.php +++ b/app/Actions/Albums/Top.php @@ -4,12 +4,12 @@ use App\Contracts\Exceptions\InternalLycheeException; use App\DTO\AlbumSortingCriterion; +use App\DTO\TopAlbumDTO; use App\Enum\ColumnSortingType; use App\Enum\OrderSortingType; use App\Exceptions\ConfigurationKeyMissingException; use App\Exceptions\Internal\InvalidOrderDirectionException; use App\Factories\AlbumFactory; -use App\Http\Resources\Collections\TopAlbumsResource; use App\Models\Album; use App\Models\Extensions\SortingDecorator; use App\Models\TagAlbum; @@ -52,11 +52,11 @@ public function __construct(AlbumFactory $albumFactory, AlbumQueryPolicy $albumQ * Note, the result may include password-protected albums that are not * accessible (but are visible). * - * @return TopAlbumsResource + * @return TopAlbumDTO * * @throws InternalLycheeException */ - public function get(): TopAlbumsResource + public function get(): TopAlbumDTO { // Do not eagerly load the relation `photos` for each smart album. // On the albums overview, we only need a thumbnail for each album. @@ -93,7 +93,7 @@ public function get(): TopAlbumsResource */ list($a, $b) = $albums->partition(fn ($album) => $album->owner_id === $userID); - return new TopAlbumsResource($smartAlbums, $tagAlbums, $a->values(), $b->values()); + return new TopAlbumDTO($smartAlbums, $tagAlbums, $a->values(), $b->values()); } else { // For anonymous users we don't want to implicitly expose // ownership via sorting. @@ -103,7 +103,7 @@ public function get(): TopAlbumsResource ->orderBy($this->sorting->column, $this->sorting->order) ->get(); - return new TopAlbumsResource($smartAlbums, $tagAlbums, $albums); + return new TopAlbumDTO($smartAlbums, $tagAlbums, $albums); } } } diff --git a/app/Actions/Albums/Tree.php b/app/Actions/Albums/Tree.php index 27ea1549170..508073798d2 100644 --- a/app/Actions/Albums/Tree.php +++ b/app/Actions/Albums/Tree.php @@ -8,7 +8,7 @@ use App\Enum\OrderSortingType; use App\Exceptions\ConfigurationKeyMissingException; use App\Exceptions\Internal\InvalidOrderDirectionException; -use App\Http\Resources\Collections\AlbumForestResource; +use App\Legacy\V1\Resources\Collections\AlbumForestResource; use App\Models\Album; use App\Models\Extensions\SortingDecorator; use App\Policies\AlbumQueryPolicy; diff --git a/app/Actions/Sharing/ListShare.php b/app/Actions/Sharing/ListShare.php index a00796019d4..5c3eab175ad 100644 --- a/app/Actions/Sharing/ListShare.php +++ b/app/Actions/Sharing/ListShare.php @@ -4,7 +4,7 @@ use App\Constants\AccessPermissionConstants as APC; use App\Exceptions\Internal\QueryBuilderException; -use App\Http\Resources\Sharing\SharesResource; +use App\Legacy\V1\Resources\Sharing\SharesResource; use App\Models\AccessPermission; use App\Models\Extensions\BaseAlbum; use App\Models\User; diff --git a/app/DTO/TopAlbumDTO.php b/app/DTO/TopAlbumDTO.php new file mode 100644 index 00000000000..bbb12c8a118 --- /dev/null +++ b/app/DTO/TopAlbumDTO.php @@ -0,0 +1,24 @@ + $smart_albums + * @param Collection $tag_albums + * @param Collection $albums + * @param Collection|null $shared_albums + */ + public function __construct( + public Collection $smart_albums, + public Collection $tag_albums, + public Collection $albums, + public ?Collection $shared_albums = null + ) { + } +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8f2f7684622..0e13dd4ac56 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -102,7 +102,6 @@ class Kernel extends HttpKernel 'migration' => \App\Http\Middleware\MigrationStatus::class, 'content_type' => \App\Http\Middleware\ContentType::class, 'accept_content_type' => \App\Http\Middleware\AcceptContentType::class, - 'redirect-legacy-id' => \App\Http\Middleware\RedirectLegacyPhotoID::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'login_required' => \App\Http\Middleware\LoginRequired::class, ]; diff --git a/app/Http/Middleware/RedirectLegacyPhotoID.php b/app/Http/Middleware/RedirectLegacyPhotoID.php deleted file mode 100644 index 8758cdb6e13..00000000000 --- a/app/Http/Middleware/RedirectLegacyPhotoID.php +++ /dev/null @@ -1,54 +0,0 @@ -query->get(GetPhotoViewRequest::URL_QUERY_PARAM); - - if (Legacy::isLegacyModelID(strval($photoID))) { - $photoID = Legacy::translateLegacyPhotoID(intval($photoID), $request); - // TODO: It would be nicer if the above method was throwing an excepion instead of returning null - if ($photoID !== null) { - return redirect()->route('view', ['p' => $photoID]); - } - } - - return $next($request); - } catch (BindingResolutionException $e) { - throw new FrameworkException('Laravel\'s container component', $e); - } catch (RouteNotFoundException $e) { - throw new FrameworkException('Symfony\'s redirection component', $e); - } - } -} diff --git a/app/Http/Requests/Album/SetAlbumCopyrightRequest.php b/app/Http/Requests/Album/SetAlbumCopyrightRequest.php deleted file mode 100644 index 04b57c8321d..00000000000 --- a/app/Http/Requests/Album/SetAlbumCopyrightRequest.php +++ /dev/null @@ -1,38 +0,0 @@ -album = $this->albumFactory->findBaseAlbumOrFail( - $values[RequestAttribute::ALBUM_ID_ATTRIBUTE], false - ); - $this->copyright = $values[RequestAttribute::COPYRIGHT_ATTRIBUTE]; - } -} diff --git a/app/Http/Requests/Album/SetAlbumDescriptionRequest.php b/app/Http/Requests/Album/SetAlbumDescriptionRequest.php deleted file mode 100644 index 82227ce3da0..00000000000 --- a/app/Http/Requests/Album/SetAlbumDescriptionRequest.php +++ /dev/null @@ -1,38 +0,0 @@ -album = $this->albumFactory->findBaseAlbumOrFail( - $values[RequestAttribute::ALBUM_ID_ATTRIBUTE] - ); - $this->description = $values[RequestAttribute::DESCRIPTION_ATTRIBUTE]; - } -} diff --git a/app/Http/Requests/Install/SetUpAdminRequest.php b/app/Http/Requests/Install/SetUpAdminRequest.php index 32ce5c0aadf..088a1acf707 100644 --- a/app/Http/Requests/Install/SetUpAdminRequest.php +++ b/app/Http/Requests/Install/SetUpAdminRequest.php @@ -2,11 +2,11 @@ namespace App\Http\Requests\Install; -use App\Contracts\Http\Requests\HasPassword; -use App\Contracts\Http\Requests\HasUsername; -use App\Contracts\Http\Requests\RequestAttribute; -use App\Http\Requests\Traits\HasPasswordTrait; -use App\Http\Requests\Traits\HasUsernameTrait; +use App\Legacy\V1\Contracts\Http\Requests\HasPassword; +use App\Legacy\V1\Contracts\Http\Requests\HasUsername; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; +use App\Legacy\V1\Requests\Traits\HasPasswordTrait; +use App\Legacy\V1\Requests\Traits\HasUsernameTrait; use App\Rules\PasswordRule; use App\Rules\UsernameRule; use Illuminate\Foundation\Http\FormRequest; diff --git a/app/Http/Requests/Legacy/TranslateIDRequest.php b/app/Http/Requests/Legacy/TranslateIDRequest.php index 22eaa72af53..7823d800890 100644 --- a/app/Http/Requests/Legacy/TranslateIDRequest.php +++ b/app/Http/Requests/Legacy/TranslateIDRequest.php @@ -2,8 +2,8 @@ namespace App\Http\Requests\Legacy; -use App\Contracts\Http\Requests\RequestAttribute; use App\Http\Requests\BaseApiRequest; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\IntegerIDRule; class TranslateIDRequest extends BaseApiRequest diff --git a/app/Http/Requests/Session/LoginRequest.php b/app/Http/Requests/Session/LoginRequest.php index 49dbd63de7f..453b157f7b8 100644 --- a/app/Http/Requests/Session/LoginRequest.php +++ b/app/Http/Requests/Session/LoginRequest.php @@ -2,13 +2,13 @@ namespace App\Http\Requests\Session; -use App\Contracts\Http\Requests\HasPassword; -use App\Contracts\Http\Requests\HasUsername; -use App\Contracts\Http\Requests\RequestAttribute; use App\Http\Requests\BaseApiRequest; -use App\Http\Requests\Traits\HasPasswordTrait; -use App\Http\Requests\Traits\HasUsernameTrait; use App\Http\RuleSets\Session\LoginRuleSet; +use App\Legacy\V1\Contracts\Http\Requests\HasPassword; +use App\Legacy\V1\Contracts\Http\Requests\HasUsername; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; +use App\Legacy\V1\Requests\Traits\HasPasswordTrait; +use App\Legacy\V1\Requests\Traits\HasUsernameTrait; class LoginRequest extends BaseApiRequest implements HasUsername, HasPassword { diff --git a/app/Http/Requests/WebAuthn/DeleteCredentialRequest.php b/app/Http/Requests/WebAuthn/DeleteCredentialRequest.php index 51b39e371d2..8aea217c2b6 100644 --- a/app/Http/Requests/WebAuthn/DeleteCredentialRequest.php +++ b/app/Http/Requests/WebAuthn/DeleteCredentialRequest.php @@ -2,9 +2,9 @@ namespace App\Http\Requests\WebAuthn; -use App\Contracts\Http\Requests\RequestAttribute; use App\Http\Requests\BaseApiRequest; use App\Http\RuleSets\WebAuthn\DeleteCredentialRuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Models\User; use App\Policies\UserPolicy; use Illuminate\Support\Facades\Gate; diff --git a/app/Http/RuleSets/AddAlbumRuleSet.php b/app/Http/RuleSets/AddAlbumRuleSet.php index ea199a81aea..1847098604d 100644 --- a/app/Http/RuleSets/AddAlbumRuleSet.php +++ b/app/Http/RuleSets/AddAlbumRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use App\Rules\TitleRule; diff --git a/app/Http/RuleSets/Album/AddAlbumRuleSet.php b/app/Http/RuleSets/Album/AddAlbumRuleSet.php index 1e6ce04f97d..bb8d7ac13c3 100644 --- a/app/Http/RuleSets/Album/AddAlbumRuleSet.php +++ b/app/Http/RuleSets/Album/AddAlbumRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use App\Rules\TitleRule; diff --git a/app/Http/RuleSets/Album/AddTagAlbumRuleSet.php b/app/Http/RuleSets/Album/AddTagAlbumRuleSet.php index 2fe026f7659..237fec4421a 100644 --- a/app/Http/RuleSets/Album/AddTagAlbumRuleSet.php +++ b/app/Http/RuleSets/Album/AddTagAlbumRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\TitleRule; /** diff --git a/app/Http/RuleSets/Album/ArchiveAlbumRuleSet.php b/app/Http/RuleSets/Album/ArchiveAlbumRuleSet.php index 6e2596353be..d5cba9f530b 100644 --- a/app/Http/RuleSets/Album/ArchiveAlbumRuleSet.php +++ b/app/Http/RuleSets/Album/ArchiveAlbumRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\AlbumIDListRule; /** diff --git a/app/Http/RuleSets/Album/BasicAlbumIdRuleSet.php b/app/Http/RuleSets/Album/BasicAlbumIdRuleSet.php index 2396ee8db6f..4de0c54c040 100644 --- a/app/Http/RuleSets/Album/BasicAlbumIdRuleSet.php +++ b/app/Http/RuleSets/Album/BasicAlbumIdRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\AlbumIDRule; /** diff --git a/app/Http/RuleSets/Album/DeleteAlbumsRuleSet.php b/app/Http/RuleSets/Album/DeleteAlbumsRuleSet.php index 62dd6f407d0..4e1a7887c3b 100644 --- a/app/Http/RuleSets/Album/DeleteAlbumsRuleSet.php +++ b/app/Http/RuleSets/Album/DeleteAlbumsRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\AlbumIDRule; /** diff --git a/app/Http/RuleSets/Album/MergeAlbumsRuleSet.php b/app/Http/RuleSets/Album/MergeAlbumsRuleSet.php index 2890feaf55d..e9d1e956e2c 100644 --- a/app/Http/RuleSets/Album/MergeAlbumsRuleSet.php +++ b/app/Http/RuleSets/Album/MergeAlbumsRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\AlbumIDRule; use App\Rules\RandomIDRule; diff --git a/app/Http/RuleSets/Album/MoveAlbumsRuleSet.php b/app/Http/RuleSets/Album/MoveAlbumsRuleSet.php index 14f8ebd0854..f5f6cc08400 100644 --- a/app/Http/RuleSets/Album/MoveAlbumsRuleSet.php +++ b/app/Http/RuleSets/Album/MoveAlbumsRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\AlbumIDRule; use App\Rules\RandomIDRule; diff --git a/app/Http/RuleSets/Album/SetAlbumCopyrightRuleSet.php b/app/Http/RuleSets/Album/SetAlbumCopyrightRuleSet.php deleted file mode 100644 index f0f89ea3956..00000000000 --- a/app/Http/RuleSets/Album/SetAlbumCopyrightRuleSet.php +++ /dev/null @@ -1,25 +0,0 @@ - ['required', new RandomIDRule(false)], - RequestAttribute::COPYRIGHT_ATTRIBUTE => ['required', new CopyrightRule()], - ]; - } -} diff --git a/app/Http/RuleSets/Album/SetAlbumCoverRuleSet.php b/app/Http/RuleSets/Album/SetAlbumCoverRuleSet.php index f7a58c73f0f..0552c53eca5 100644 --- a/app/Http/RuleSets/Album/SetAlbumCoverRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumCoverRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Album/SetAlbumDescriptionRuleSet.php b/app/Http/RuleSets/Album/SetAlbumDescriptionRuleSet.php index 0f5212d17e6..48e55b2a9c0 100644 --- a/app/Http/RuleSets/Album/SetAlbumDescriptionRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumDescriptionRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\DescriptionRule; use App\Rules\RandomIDRule; diff --git a/app/Http/RuleSets/Album/SetAlbumHeaderRuleSet.php b/app/Http/RuleSets/Album/SetAlbumHeaderRuleSet.php index 2d32d17cc39..62dabc951b5 100644 --- a/app/Http/RuleSets/Album/SetAlbumHeaderRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumHeaderRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Album/SetAlbumLicenseRuleSet.php b/app/Http/RuleSets/Album/SetAlbumLicenseRuleSet.php index c7a01017f24..c8f92b16100 100644 --- a/app/Http/RuleSets/Album/SetAlbumLicenseRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumLicenseRuleSet.php @@ -2,9 +2,9 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; use App\Enum\LicenseType; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/RuleSets/Album/SetAlbumNSFWRuleSet.php b/app/Http/RuleSets/Album/SetAlbumNSFWRuleSet.php index f44e115abb3..8b8e875c7fc 100644 --- a/app/Http/RuleSets/Album/SetAlbumNSFWRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumNSFWRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Album/SetAlbumSortingRuleSet.php b/app/Http/RuleSets/Album/SetAlbumSortingRuleSet.php index 026aff54664..f22957e7b2b 100644 --- a/app/Http/RuleSets/Album/SetAlbumSortingRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumSortingRuleSet.php @@ -2,10 +2,10 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; use App\Enum\ColumnSortingAlbumType; use App\Enum\OrderSortingType; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/RuleSets/Album/SetAlbumSortingRuleSetLegacy.php b/app/Http/RuleSets/Album/SetAlbumSortingRuleSetLegacy.php index ecafade3cd5..3e897c611cb 100644 --- a/app/Http/RuleSets/Album/SetAlbumSortingRuleSetLegacy.php +++ b/app/Http/RuleSets/Album/SetAlbumSortingRuleSetLegacy.php @@ -2,10 +2,10 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; use App\Enum\ColumnSortingPhotoType; use App\Enum\OrderSortingType; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/RuleSets/Album/SetAlbumTagRuleSet.php b/app/Http/RuleSets/Album/SetAlbumTagRuleSet.php index 42179063e36..452db87a68e 100644 --- a/app/Http/RuleSets/Album/SetAlbumTagRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumTagRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Album/SetAlbumsTitleRuleSet.php b/app/Http/RuleSets/Album/SetAlbumsTitleRuleSet.php index e31d1374a9f..acaa48d711a 100644 --- a/app/Http/RuleSets/Album/SetAlbumsTitleRuleSet.php +++ b/app/Http/RuleSets/Album/SetAlbumsTitleRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use App\Rules\TitleRule; diff --git a/app/Http/RuleSets/Album/SetPhotoSortingRuleSet.php b/app/Http/RuleSets/Album/SetPhotoSortingRuleSet.php index 4ffc0094b12..e9fb885c26f 100644 --- a/app/Http/RuleSets/Album/SetPhotoSortingRuleSet.php +++ b/app/Http/RuleSets/Album/SetPhotoSortingRuleSet.php @@ -2,10 +2,10 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; use App\Enum\ColumnSortingPhotoType; use App\Enum\OrderSortingType; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/RuleSets/Album/UnlockAlbumRuleSet.php b/app/Http/RuleSets/Album/UnlockAlbumRuleSet.php index 548e6d58b4a..60f390d7dd4 100644 --- a/app/Http/RuleSets/Album/UnlockAlbumRuleSet.php +++ b/app/Http/RuleSets/Album/UnlockAlbumRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Album; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\PasswordRule; use App\Rules\RandomIDRule; diff --git a/app/Http/RuleSets/ChangeLoginRuleSet.php b/app/Http/RuleSets/ChangeLoginRuleSet.php index c26dc678f60..b5a78621939 100644 --- a/app/Http/RuleSets/ChangeLoginRuleSet.php +++ b/app/Http/RuleSets/ChangeLoginRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\PasswordRule; use App\Rules\UsernameRule; diff --git a/app/Http/RuleSets/Import/ImportFromUrlRuleSet.php b/app/Http/RuleSets/Import/ImportFromUrlRuleSet.php index e5b4df66def..7a80cd0ee51 100644 --- a/app/Http/RuleSets/Import/ImportFromUrlRuleSet.php +++ b/app/Http/RuleSets/Import/ImportFromUrlRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Import; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Import/ImportServerRuleSet.php b/app/Http/RuleSets/Import/ImportServerRuleSet.php index 22331046aae..4737a6ff8d2 100644 --- a/app/Http/RuleSets/Import/ImportServerRuleSet.php +++ b/app/Http/RuleSets/Import/ImportServerRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Import; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/LoginRuleSet.php b/app/Http/RuleSets/LoginRuleSet.php index e8feffcc82b..7245d2e8c94 100644 --- a/app/Http/RuleSets/LoginRuleSet.php +++ b/app/Http/RuleSets/LoginRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\PasswordRule; use App\Rules\UsernameRule; diff --git a/app/Http/RuleSets/Photo/AddPhotoRuleSet.php b/app/Http/RuleSets/Photo/AddPhotoRuleSet.php index cf750bcfa89..4e7edc0945f 100644 --- a/app/Http/RuleSets/Photo/AddPhotoRuleSet.php +++ b/app/Http/RuleSets/Photo/AddPhotoRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\AlbumIDRule; /** diff --git a/app/Http/RuleSets/Photo/ArchivePhotosRuleSet.php b/app/Http/RuleSets/Photo/ArchivePhotosRuleSet.php index 2675ab70556..bd9327019a8 100644 --- a/app/Http/RuleSets/Photo/ArchivePhotosRuleSet.php +++ b/app/Http/RuleSets/Photo/ArchivePhotosRuleSet.php @@ -2,9 +2,9 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; use App\Enum\DownloadVariantType; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDListRule; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/RuleSets/Photo/DeletePhotosRuleSet.php b/app/Http/RuleSets/Photo/DeletePhotosRuleSet.php index f0b57074b0d..2e2a3cbe93d 100644 --- a/app/Http/RuleSets/Photo/DeletePhotosRuleSet.php +++ b/app/Http/RuleSets/Photo/DeletePhotosRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/DuplicatePhotosRuleSet.php b/app/Http/RuleSets/Photo/DuplicatePhotosRuleSet.php index 7ae7d0ba343..17ed8ccb740 100644 --- a/app/Http/RuleSets/Photo/DuplicatePhotosRuleSet.php +++ b/app/Http/RuleSets/Photo/DuplicatePhotosRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/GetPhotoRuleSet.php b/app/Http/RuleSets/Photo/GetPhotoRuleSet.php index 33e548f8c3e..b55985ac64d 100644 --- a/app/Http/RuleSets/Photo/GetPhotoRuleSet.php +++ b/app/Http/RuleSets/Photo/GetPhotoRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/MovePhotosRuleSet.php b/app/Http/RuleSets/Photo/MovePhotosRuleSet.php index b55e52269ab..c26a392395e 100644 --- a/app/Http/RuleSets/Photo/MovePhotosRuleSet.php +++ b/app/Http/RuleSets/Photo/MovePhotosRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/RotatePhotoRuleSet.php b/app/Http/RuleSets/Photo/RotatePhotoRuleSet.php index 3aa08441866..b11163431c6 100644 --- a/app/Http/RuleSets/Photo/RotatePhotoRuleSet.php +++ b/app/Http/RuleSets/Photo/RotatePhotoRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use Illuminate\Validation\Rule; diff --git a/app/Http/RuleSets/Photo/SetPhotoDescriptionRuleSet.php b/app/Http/RuleSets/Photo/SetPhotoDescriptionRuleSet.php index 94d9024d0f6..5395f5a8bff 100644 --- a/app/Http/RuleSets/Photo/SetPhotoDescriptionRuleSet.php +++ b/app/Http/RuleSets/Photo/SetPhotoDescriptionRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\DescriptionRule; use App\Rules\RandomIDRule; diff --git a/app/Http/RuleSets/Photo/SetPhotoLicenseRuleSet.php b/app/Http/RuleSets/Photo/SetPhotoLicenseRuleSet.php index 6d8497e5d38..5ee231e147b 100644 --- a/app/Http/RuleSets/Photo/SetPhotoLicenseRuleSet.php +++ b/app/Http/RuleSets/Photo/SetPhotoLicenseRuleSet.php @@ -2,9 +2,9 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; use App\Enum\LicenseType; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use Illuminate\Validation\Rules\Enum; diff --git a/app/Http/RuleSets/Photo/SetPhotoUploadDateRuleSet.php b/app/Http/RuleSets/Photo/SetPhotoUploadDateRuleSet.php index 4901f2fe9b3..9e763f7d6c1 100644 --- a/app/Http/RuleSets/Photo/SetPhotoUploadDateRuleSet.php +++ b/app/Http/RuleSets/Photo/SetPhotoUploadDateRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/SetPhotosStarredRuleSet.php b/app/Http/RuleSets/Photo/SetPhotosStarredRuleSet.php index 62067796fe2..e9bc0a663a9 100644 --- a/app/Http/RuleSets/Photo/SetPhotosStarredRuleSet.php +++ b/app/Http/RuleSets/Photo/SetPhotosStarredRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/SetPhotosTagsRuleSet.php b/app/Http/RuleSets/Photo/SetPhotosTagsRuleSet.php index 0b2700f8592..bc4739dbf02 100644 --- a/app/Http/RuleSets/Photo/SetPhotosTagsRuleSet.php +++ b/app/Http/RuleSets/Photo/SetPhotosTagsRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; /** diff --git a/app/Http/RuleSets/Photo/SetPhotosTitleRuleSet.php b/app/Http/RuleSets/Photo/SetPhotosTitleRuleSet.php index ef2fe27b6b6..75fc0a95ee5 100644 --- a/app/Http/RuleSets/Photo/SetPhotosTitleRuleSet.php +++ b/app/Http/RuleSets/Photo/SetPhotosTitleRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Photo; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\RandomIDRule; use App\Rules\TitleRule; diff --git a/app/Http/RuleSets/Session/LoginRuleSet.php b/app/Http/RuleSets/Session/LoginRuleSet.php index c7499286838..ebfe8f7ea32 100644 --- a/app/Http/RuleSets/Session/LoginRuleSet.php +++ b/app/Http/RuleSets/Session/LoginRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Session; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\PasswordRule; use App\Rules\UsernameRule; diff --git a/app/Http/RuleSets/User/ChangeLoginRuleSet.php b/app/Http/RuleSets/User/ChangeLoginRuleSet.php index ddc7bbc0199..5a692d579f4 100644 --- a/app/Http/RuleSets/User/ChangeLoginRuleSet.php +++ b/app/Http/RuleSets/User/ChangeLoginRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\User; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\PasswordRule; use App\Rules\UsernameRule; diff --git a/app/Http/RuleSets/User/SetEmailRuleSet.php b/app/Http/RuleSets/User/SetEmailRuleSet.php index d42fb0837b0..9d9b34cd57c 100644 --- a/app/Http/RuleSets/User/SetEmailRuleSet.php +++ b/app/Http/RuleSets/User/SetEmailRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\User; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; /** * Rules applied when setting a email for notifications. diff --git a/app/Http/RuleSets/Users/AddUserRuleSet.php b/app/Http/RuleSets/Users/AddUserRuleSet.php index c90f0fcdf79..989dbb78317 100644 --- a/app/Http/RuleSets/Users/AddUserRuleSet.php +++ b/app/Http/RuleSets/Users/AddUserRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Users; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\PasswordRule; use App\Rules\UsernameRule; diff --git a/app/Http/RuleSets/Users/SetUserSettingsRuleSet.php b/app/Http/RuleSets/Users/SetUserSettingsRuleSet.php index 61e5ae1ee27..7f29ffa54aa 100644 --- a/app/Http/RuleSets/Users/SetUserSettingsRuleSet.php +++ b/app/Http/RuleSets/Users/SetUserSettingsRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\Users; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Rules\IntegerIDRule; use App\Rules\PasswordRule; use App\Rules\UsernameRule; diff --git a/app/Http/RuleSets/WebAuthn/DeleteCredentialRuleSet.php b/app/Http/RuleSets/WebAuthn/DeleteCredentialRuleSet.php index cf8a4ce0249..1dd30a13e2f 100644 --- a/app/Http/RuleSets/WebAuthn/DeleteCredentialRuleSet.php +++ b/app/Http/RuleSets/WebAuthn/DeleteCredentialRuleSet.php @@ -2,8 +2,8 @@ namespace App\Http\RuleSets\WebAuthn; -use App\Contracts\Http\Requests\RequestAttribute; use App\Contracts\Http\RuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; /** * Rules applied when deleting a credential. diff --git a/app/Contracts/Http/Requests/HasAbstractAlbum.php b/app/Legacy/V1/Contracts/Http/Requests/HasAbstractAlbum.php similarity index 76% rename from app/Contracts/Http/Requests/HasAbstractAlbum.php rename to app/Legacy/V1/Contracts/Http/Requests/HasAbstractAlbum.php index 7879c2613fa..8d6dee81346 100644 --- a/app/Contracts/Http/Requests/HasAbstractAlbum.php +++ b/app/Legacy/V1/Contracts/Http/Requests/HasAbstractAlbum.php @@ -1,6 +1,6 @@ get(); - return $top->get(); + return new TopAlbumsResource( + smart_albums: $dto->smart_albums, + tag_albums: $dto->tag_albums, + albums: $dto->albums, + shared_albums: $dto->shared_albums); } /** diff --git a/app/Http/Controllers/ImportController.php b/app/Legacy/V1/Controllers/ImportController.php similarity index 92% rename from app/Http/Controllers/ImportController.php rename to app/Legacy/V1/Controllers/ImportController.php index aa36e3f00ed..a733d9336a0 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Legacy/V1/Controllers/ImportController.php @@ -1,15 +1,15 @@ fileExists($fileName)) { $cssCacheBusting = '?' . Storage::disk('dist')->lastModified($fileName); } + /** @disregard P1013 */ return Storage::disk('dist')->url($fileName) . $cssCacheBusting; } } diff --git a/app/Http/Controllers/LegacyController.php b/app/Legacy/V1/Controllers/LegacyController.php similarity index 97% rename from app/Http/Controllers/LegacyController.php rename to app/Legacy/V1/Controllers/LegacyController.php index 56037595fc3..5f11abf0596 100644 --- a/app/Http/Controllers/LegacyController.php +++ b/app/Legacy/V1/Controllers/LegacyController.php @@ -1,6 +1,6 @@ getRequestUri(), $dir_url . '/livewire/')) { + return $next($request); + } + + if ($requiredStatus !== self::ALBUM && $requiredStatus !== self::ROOT) { + throw new LycheeLogicException($requiredStatus . ' is not a valid login requirement.'); + } + + try { + if (!Configs::getValueAsBool('login_required')) { + // Login is not required. Proceed. + return $next($request); + } + + if ($requiredStatus === self::ALBUM && Configs::getValueAsBool('login_required_root_only')) { + return $next($request); + } + + return redirect()->route('login'); + } catch (ConfigurationKeyMissingException $e) { + Log::warning(__METHOD__ . ':' . __LINE__ . ' ' . $e->getMessage()); + + return $next($request); + } + } +} diff --git a/app/Http/Requests/Album/AddAlbumRequest.php b/app/Legacy/V1/Requests/Album/AddAlbumRequest.php similarity index 75% rename from app/Http/Requests/Album/AddAlbumRequest.php rename to app/Legacy/V1/Requests/Album/AddAlbumRequest.php index ff81a4b78e2..e7044036cc1 100644 --- a/app/Http/Requests/Album/AddAlbumRequest.php +++ b/app/Legacy/V1/Requests/Album/AddAlbumRequest.php @@ -1,15 +1,15 @@ ['required', new AlbumIDListRule()], + ]; } /** diff --git a/app/Http/Requests/Album/DeleteAlbumsRequest.php b/app/Legacy/V1/Requests/Album/DeleteAlbumsRequest.php similarity index 81% rename from app/Http/Requests/Album/DeleteAlbumsRequest.php rename to app/Legacy/V1/Requests/Album/DeleteAlbumsRequest.php index 0719aaf78f1..dde7ce1859a 100644 --- a/app/Http/Requests/Album/DeleteAlbumsRequest.php +++ b/app/Legacy/V1/Requests/Album/DeleteAlbumsRequest.php @@ -1,12 +1,12 @@ ['required', new RandomIDRule(false)], + RequestAttribute::COPYRIGHT_ATTRIBUTE => ['required', new CopyrightRule()], + ]; + } + + /** + * {@inheritDoc} + */ + protected function processValidatedValues(array $values, array $files): void + { + $this->album = $this->albumFactory->findBaseAlbumOrFail( + $values[RequestAttribute::ALBUM_ID_ATTRIBUTE], false + ); + $this->copyright = $values[RequestAttribute::COPYRIGHT_ATTRIBUTE]; + } +} diff --git a/app/Http/Requests/Album/SetAlbumCoverRequest.php b/app/Legacy/V1/Requests/Album/SetAlbumCoverRequest.php similarity index 79% rename from app/Http/Requests/Album/SetAlbumCoverRequest.php rename to app/Legacy/V1/Requests/Album/SetAlbumCoverRequest.php index 9055c43088d..b1c69132975 100644 --- a/app/Http/Requests/Album/SetAlbumCoverRequest.php +++ b/app/Legacy/V1/Requests/Album/SetAlbumCoverRequest.php @@ -1,15 +1,15 @@ ['required', new RandomIDRule(false)], + RequestAttribute::DESCRIPTION_ATTRIBUTE => ['present', new DescriptionRule()], + ]; + } + + /** + * {@inheritDoc} + */ + protected function processValidatedValues(array $values, array $files): void + { + $this->album = $this->albumFactory->findBaseAlbumOrFail( + $values[RequestAttribute::ALBUM_ID_ATTRIBUTE] + ); + $this->description = $values[RequestAttribute::DESCRIPTION_ATTRIBUTE]; + } +} diff --git a/app/Http/Requests/Album/SetAlbumHeaderRequest.php b/app/Legacy/V1/Requests/Album/SetAlbumHeaderRequest.php similarity index 79% rename from app/Http/Requests/Album/SetAlbumHeaderRequest.php rename to app/Legacy/V1/Requests/Album/SetAlbumHeaderRequest.php index 40be67cfa51..458c6a9b136 100644 --- a/app/Http/Requests/Album/SetAlbumHeaderRequest.php +++ b/app/Legacy/V1/Requests/Album/SetAlbumHeaderRequest.php @@ -1,15 +1,15 @@ ['required', new RandomIDRule(false)], + RequestAttribute::LICENSE_ATTRIBUTE => ['required', new Enum(LicenseType::class)], + ]; } /** diff --git a/app/Http/Requests/Album/SetAlbumNSFWRequest.php b/app/Legacy/V1/Requests/Album/SetAlbumNSFWRequest.php similarity index 59% rename from app/Http/Requests/Album/SetAlbumNSFWRequest.php rename to app/Legacy/V1/Requests/Album/SetAlbumNSFWRequest.php index 1341e485cc9..d603716e02e 100644 --- a/app/Http/Requests/Album/SetAlbumNSFWRequest.php +++ b/app/Legacy/V1/Requests/Album/SetAlbumNSFWRequest.php @@ -1,13 +1,13 @@ ['required', new RandomIDRule(false)], + RequestAttribute::IS_NSFW_ATTRIBUTE => 'required|boolean', + ]; } /** diff --git a/app/Http/Requests/Album/SetAlbumProtectionPolicyRequest.php b/app/Legacy/V1/Requests/Album/SetAlbumProtectionPolicyRequest.php similarity index 62% rename from app/Http/Requests/Album/SetAlbumProtectionPolicyRequest.php rename to app/Legacy/V1/Requests/Album/SetAlbumProtectionPolicyRequest.php index 95a1647d007..762e6e285be 100644 --- a/app/Http/Requests/Album/SetAlbumProtectionPolicyRequest.php +++ b/app/Legacy/V1/Requests/Album/SetAlbumProtectionPolicyRequest.php @@ -1,16 +1,17 @@ ['required', new RandomIDRule(false)], + RequestAttribute::PASSWORD_ATTRIBUTE => ['sometimes', new PasswordRule(true)], + RequestAttribute::IS_PUBLIC_ATTRIBUTE => 'required|boolean', + RequestAttribute::IS_LINK_REQUIRED_ATTRIBUTE => 'required|boolean', + RequestAttribute::IS_NSFW_ATTRIBUTE => 'required|boolean', + RequestAttribute::GRANTS_DOWNLOAD_ATTRIBUTE => 'required|boolean', + RequestAttribute::GRANTS_FULL_PHOTO_ACCESS_ATTRIBUTE => 'required|boolean', + ]; } /** diff --git a/app/Http/Requests/Album/SetAlbumSortingRequest.php b/app/Legacy/V1/Requests/Album/SetAlbumSortingRequest.php similarity index 52% rename from app/Http/Requests/Album/SetAlbumSortingRequest.php rename to app/Legacy/V1/Requests/Album/SetAlbumSortingRequest.php index e5d87197139..43aadcd8408 100644 --- a/app/Http/Requests/Album/SetAlbumSortingRequest.php +++ b/app/Legacy/V1/Requests/Album/SetAlbumSortingRequest.php @@ -1,18 +1,19 @@ ['required', new RandomIDRule(false)], + RequestAttribute::SORTING_COLUMN_ATTRIBUTE => ['present', 'nullable', new Enum(ColumnSortingPhotoType::class)], + RequestAttribute::SORTING_ORDER_ATTRIBUTE => [ + 'required_with:' . RequestAttribute::SORTING_COLUMN_ATTRIBUTE, + 'nullable', new Enum(OrderSortingType::class), + ], + ]; } /** diff --git a/app/Http/Requests/Album/SetAlbumTagsRequest.php b/app/Legacy/V1/Requests/Album/SetAlbumTagsRequest.php similarity index 64% rename from app/Http/Requests/Album/SetAlbumTagsRequest.php rename to app/Legacy/V1/Requests/Album/SetAlbumTagsRequest.php index 1a5c4a787fb..e44acd3c027 100644 --- a/app/Http/Requests/Album/SetAlbumTagsRequest.php +++ b/app/Legacy/V1/Requests/Album/SetAlbumTagsRequest.php @@ -1,15 +1,15 @@ albumSortingCriterion; + } +} diff --git a/app/Http/Requests/Traits/HasAlbumTrait.php b/app/Legacy/V1/Requests/Traits/HasAlbumTrait.php similarity index 81% rename from app/Http/Requests/Traits/HasAlbumTrait.php rename to app/Legacy/V1/Requests/Traits/HasAlbumTrait.php index ca2a83f680b..d870cbcad29 100644 --- a/app/Http/Requests/Traits/HasAlbumTrait.php +++ b/app/Legacy/V1/Requests/Traits/HasAlbumTrait.php @@ -1,6 +1,6 @@ aspectRatio(); + } +} diff --git a/app/Http/Requests/Traits/HasBaseAlbumTrait.php b/app/Legacy/V1/Requests/Traits/HasBaseAlbumTrait.php similarity index 83% rename from app/Http/Requests/Traits/HasBaseAlbumTrait.php rename to app/Legacy/V1/Requests/Traits/HasBaseAlbumTrait.php index eec39cd182f..c8eee2fa9bb 100644 --- a/app/Http/Requests/Traits/HasBaseAlbumTrait.php +++ b/app/Legacy/V1/Requests/Traits/HasBaseAlbumTrait.php @@ -1,6 +1,6 @@ photoSortingCriterion; + } +} diff --git a/app/Http/Requests/Traits/HasPhotoTrait.php b/app/Legacy/V1/Requests/Traits/HasPhotoTrait.php similarity index 81% rename from app/Http/Requests/Traits/HasPhotoTrait.php rename to app/Legacy/V1/Requests/Traits/HasPhotoTrait.php index 6943610c539..8abbc9142d8 100644 --- a/app/Http/Requests/Traits/HasPhotoTrait.php +++ b/app/Legacy/V1/Requests/Traits/HasPhotoTrait.php @@ -1,6 +1,6 @@ topAlbums->shared_albums; + return $this->topAlbums?->shared_albums ?? collect([]); } private function checkFrameAccess(): void diff --git a/app/Livewire/Components/Pages/Gallery/BaseAlbumComponent.php b/app/Livewire/Components/Pages/Gallery/BaseAlbumComponent.php index c92235a6ec7..beb5a4e00e7 100644 --- a/app/Livewire/Components/Pages/Gallery/BaseAlbumComponent.php +++ b/app/Livewire/Components/Pages/Gallery/BaseAlbumComponent.php @@ -5,7 +5,7 @@ use App\Enum\ImageOverlayType; use App\Enum\LicenseType; use App\Enum\MapProviders; -use App\Http\Resources\Collections\PhotoCollectionResource; +use App\Legacy\V1\Resources\Collections\PhotoCollectionResource; use App\Livewire\DTO\AlbumFlags; use App\Livewire\DTO\AlbumFormatted; use App\Livewire\DTO\AlbumRights; diff --git a/app/Livewire/Forms/ImportFromUrlForm.php b/app/Livewire/Forms/ImportFromUrlForm.php index 77831d15fb1..caa2790a8c7 100644 --- a/app/Livewire/Forms/ImportFromUrlForm.php +++ b/app/Livewire/Forms/ImportFromUrlForm.php @@ -2,7 +2,7 @@ namespace App\Livewire\Forms; -use App\Contracts\Http\Requests\RequestAttribute; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Models\Album; use App\Rules\RandomIDRule; use Livewire\Attributes\Locked; diff --git a/app/Livewire/Forms/PhotoUpdateForm.php b/app/Livewire/Forms/PhotoUpdateForm.php index d8d9c340d87..e8620526dfb 100644 --- a/app/Livewire/Forms/PhotoUpdateForm.php +++ b/app/Livewire/Forms/PhotoUpdateForm.php @@ -2,9 +2,9 @@ namespace App\Livewire\Forms; -use App\Contracts\Http\Requests\RequestAttribute; use App\Enum\LicenseType; use App\Http\RuleSets\Photo\SetPhotoDescriptionRuleSet; +use App\Legacy\V1\Contracts\Http\Requests\RequestAttribute; use App\Models\Photo; use App\Rules\TitleRule; use Illuminate\Support\Facades\Validator as ValidatorFacade; diff --git a/app/Livewire/Traits/UsePhotoViewActions.php b/app/Livewire/Traits/UsePhotoViewActions.php index 564e70be1be..2804dfb9d1c 100644 --- a/app/Livewire/Traits/UsePhotoViewActions.php +++ b/app/Livewire/Traits/UsePhotoViewActions.php @@ -4,7 +4,7 @@ use App\Actions\Photo\Rotate; use App\Enum\Livewire\NotificationType; -use App\Http\Resources\Models\PhotoResource; +use App\Legacy\V1\Resources\Models\PhotoResource; use App\Livewire\Forms\PhotoUpdateForm; use App\Models\Configs; use App\Models\Photo; diff --git a/app/View/Components/Gallery/Photo/Download.php b/app/View/Components/Gallery/Photo/Download.php index 76b7c8f5af6..5357be75304 100644 --- a/app/View/Components/Gallery/Photo/Download.php +++ b/app/View/Components/Gallery/Photo/Download.php @@ -4,7 +4,7 @@ use App\Enum\SizeVariantType; use App\Facades\Helpers; -use App\Http\Resources\Models\SizeVariantResource; +use App\Legacy\V1\Resources\Models\SizeVariantResource; use App\Models\Photo; use App\Policies\PhotoPolicy; use Illuminate\Support\Facades\Gate; diff --git a/app/View/Components/Meta.php b/app/View/Components/Meta.php index 909abae6ef4..d5c0826bd0b 100644 --- a/app/View/Components/Meta.php +++ b/app/View/Components/Meta.php @@ -3,7 +3,7 @@ namespace App\View\Components; use App\Exceptions\ConfigurationKeyMissingException; -use App\Http\Controllers\IndexController; +use App\Legacy\V1\Controllers\IndexController; use App\Models\Configs; use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\View\Component; diff --git a/config/feed.php b/config/feed.php index c9a9de98921..ec692629242 100644 --- a/config/feed.php +++ b/config/feed.php @@ -11,7 +11,7 @@ * You can also pass an argument to that method. Note that their key must be the name of the parameter: * * [App\Model::class, 'getAllFeedItems', 'parameterName' => 'argument'] */ - 'items' => 'App\Http\Controllers\RSSController@getRSS', + 'items' => [App\Legacy\V1\Controllers\RSSController::class, 'getRSS'], /* * The feed will be available on this url. diff --git a/phpunit.xml b/phpunit.xml index 6ad0b548a05..075a4bed1ee 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,17 +7,17 @@ - - ./tests/Feature - ./tests/Feature/Base/BasePhotoTest.php - ./tests/Feature/Base/BasePhotosRotateTest.php - ./tests/Feature/Base/BaseSharingTest.php - ./tests/Feature/LibUnitTests/AlbumsUnitTest.php - ./tests/Feature/LibUnitTests/PhotosUnitTest.php - ./tests/Feature/LibUnitTests/RootAlbumUnitTest.php - ./tests/Feature/LibUnitTests/SessionUnitTest.php - ./tests/Feature/LibUnitTests/SharingUnitTest.php - ./tests/Feature/LibUnitTests/UsersUnitTest.php + + ./tests/Feature_v1 + ./tests/Feature_v1/Base/BasePhotoTest.php + ./tests/Feature_v1/Base/BasePhotosRotateTest.php + ./tests/Feature_v1/Base/BaseSharingTest.php + ./tests/Feature_v1/LibUnitTests/AlbumsUnitTest.php + ./tests/Feature_v1/LibUnitTests/PhotosUnitTest.php + ./tests/Feature_v1/LibUnitTests/RootAlbumUnitTest.php + ./tests/Feature_v1/LibUnitTests/SessionUnitTest.php + ./tests/Feature_v1/LibUnitTests/SharingUnitTest.php + ./tests/Feature_v1/LibUnitTests/UsersUnitTest.php ./tests/Livewire diff --git a/routes/api.php b/routes/api.php index b450f2927a1..46db3fb4b8d 100644 --- a/routes/api.php +++ b/routes/api.php @@ -3,6 +3,20 @@ namespace App\Http\Controllers; use App\Exceptions\Internal\NotImplementedException; +use App\Legacy\V1\Controllers\Administration\DiagnosticsController as AdministrationDiagnosticsController; +use App\Legacy\V1\Controllers\Administration\SettingsController as AdministrationSettingsController; +use App\Legacy\V1\Controllers\Administration\SharingController as AdministrationSharingController; +use App\Legacy\V1\Controllers\Administration\UpdateController as AdministrationUpdateController; +use App\Legacy\V1\Controllers\Administration\UserController as AdministrationUserController; +use App\Legacy\V1\Controllers\Administration\UsersController as AdministrationUsersController; +use App\Legacy\V1\Controllers\AlbumController; +use App\Legacy\V1\Controllers\AlbumsController; +use App\Legacy\V1\Controllers\ImportController; +use App\Legacy\V1\Controllers\LegacyController; +use App\Legacy\V1\Controllers\PhotoController; +use App\Legacy\V1\Controllers\PhotoEditorController; +use App\Legacy\V1\Controllers\SearchController; +use App\Legacy\V1\Controllers\SessionController; use Illuminate\Support\Facades\Route; /* @@ -105,19 +119,19 @@ /** * USER. */ -Route::post('/User::updateLogin', [Administration\UserController::class, 'updateLogin']); -Route::post('/User::setEmail', [Administration\UserController::class, 'setEmail']); -Route::post('/User::getAuthenticatedUser', [Administration\UserController::class, 'getAuthenticatedUser']); -Route::post('/User::resetToken', [Administration\UserController::class, 'resetToken']); -Route::post('/User::unsetToken', [Administration\UserController::class, 'unsetToken']); +Route::post('/User::updateLogin', [AdministrationUserController::class, 'updateLogin']); +Route::post('/User::setEmail', [AdministrationUserController::class, 'setEmail']); +Route::post('/User::getAuthenticatedUser', [AdministrationUserController::class, 'getAuthenticatedUser']); +Route::post('/User::resetToken', [AdministrationUserController::class, 'resetToken']); +Route::post('/User::unsetToken', [AdministrationUserController::class, 'unsetToken']); /** * USERS. */ -Route::post('/Users::list', [Administration\UsersController::class, 'list']); -Route::post('/Users::save', [Administration\UsersController::class, 'save']); -Route::post('/Users::delete', [Administration\UsersController::class, 'delete']); -Route::post('/Users::create', [Administration\UsersController::class, 'create']); +Route::post('/Users::list', [AdministrationUsersController::class, 'list']); +Route::post('/Users::save', [AdministrationUsersController::class, 'save']); +Route::post('/Users::delete', [AdministrationUsersController::class, 'delete']); +Route::post('/Users::create', [AdministrationUsersController::class, 'create']); /** * WEBAUTHN. @@ -136,46 +150,46 @@ /** * SHARING. */ -Route::post('/Sharing::list', [Administration\SharingController::class, 'list']); -Route::post('/Sharing::add', [Administration\SharingController::class, 'add']); -Route::post('/Sharing::setByAlbum', [Administration\SharingController::class, 'setByAlbum']); -Route::post('/Sharing::delete', [Administration\SharingController::class, 'delete']); +Route::post('/Sharing::list', [AdministrationSharingController::class, 'list']); +Route::post('/Sharing::add', [AdministrationSharingController::class, 'add']); +Route::post('/Sharing::setByAlbum', [AdministrationSharingController::class, 'setByAlbum']); +Route::post('/Sharing::delete', [AdministrationSharingController::class, 'delete']); /** * DIAGNOSTICS. */ -Route::post('/Diagnostics::get', [Administration\DiagnosticsController::class, 'get']); -Route::post('/Diagnostics::getSize', [Administration\DiagnosticsController::class, 'getSize']); +Route::post('/Diagnostics::get', [AdministrationDiagnosticsController::class, 'get']); +Route::post('/Diagnostics::getSize', [AdministrationDiagnosticsController::class, 'getSize']); /** * SETTINGS. */ -Route::post('/Settings::setSorting', [Administration\SettingsController::class, 'setSorting']); -Route::post('/Settings::setLang', [Administration\SettingsController::class, 'setLang']); -Route::post('/Settings::setLayout', [Administration\SettingsController::class, 'setLayout']); -Route::post('/Settings::setPublicSearch', [Administration\SettingsController::class, 'setPublicSearch']); -Route::post('/Settings::setDefaultLicense', [Administration\SettingsController::class, 'setDefaultLicense']); -Route::post('/Settings::setMapDisplay', [Administration\SettingsController::class, 'setMapDisplay']); -Route::post('/Settings::setMapDisplayPublic', [Administration\SettingsController::class, 'setMapDisplayPublic']); -Route::post('/Settings::setMapProvider', [Administration\SettingsController::class, 'setMapProvider']); -Route::post('/Settings::setMapIncludeSubAlbums', [Administration\SettingsController::class, 'setMapIncludeSubAlbums']); -Route::post('/Settings::setLocationDecoding', [Administration\SettingsController::class, 'setLocationDecoding']); -Route::post('/Settings::setLocationShow', [Administration\SettingsController::class, 'setLocationShow']); -Route::post('/Settings::setLocationShowPublic', [Administration\SettingsController::class, 'setLocationShowPublic']); -Route::post('/Settings::setCSS', [Administration\SettingsController::class, 'setCSS']); -Route::post('/Settings::setJS', [Administration\SettingsController::class, 'setJS']); -Route::post('/Settings::getAll', [Administration\SettingsController::class, 'getAll']); -Route::post('/Settings::saveAll', [Administration\SettingsController::class, 'saveAll']); -Route::post('/Settings::setAlbumDecoration', [Administration\SettingsController::class, 'setAlbumDecoration']); -Route::post('/Settings::setOverlayType', [Administration\SettingsController::class, 'setImageOverlayType']); -Route::post('/Settings::setNSFWVisible', [Administration\SettingsController::class, 'setNSFWVisible']); -Route::post('/Settings::setDropboxKey', [Administration\SettingsController::class, 'setDropboxKey']); -Route::post('/Settings::setNewPhotosNotification', [Administration\SettingsController::class, 'setNewPhotosNotification']); -Route::post('/Settings::setSmartAlbumVisibility', [Administration\SettingsController::class, 'setSmartAlbumVisibility']); +Route::post('/Settings::setSorting', [AdministrationSettingsController::class, 'setSorting']); +Route::post('/Settings::setLang', [AdministrationSettingsController::class, 'setLang']); +Route::post('/Settings::setLayout', [AdministrationSettingsController::class, 'setLayout']); +Route::post('/Settings::setPublicSearch', [AdministrationSettingsController::class, 'setPublicSearch']); +Route::post('/Settings::setDefaultLicense', [AdministrationSettingsController::class, 'setDefaultLicense']); +Route::post('/Settings::setMapDisplay', [AdministrationSettingsController::class, 'setMapDisplay']); +Route::post('/Settings::setMapDisplayPublic', [AdministrationSettingsController::class, 'setMapDisplayPublic']); +Route::post('/Settings::setMapProvider', [AdministrationSettingsController::class, 'setMapProvider']); +Route::post('/Settings::setMapIncludeSubAlbums', [AdministrationSettingsController::class, 'setMapIncludeSubAlbums']); +Route::post('/Settings::setLocationDecoding', [AdministrationSettingsController::class, 'setLocationDecoding']); +Route::post('/Settings::setLocationShow', [AdministrationSettingsController::class, 'setLocationShow']); +Route::post('/Settings::setLocationShowPublic', [AdministrationSettingsController::class, 'setLocationShowPublic']); +Route::post('/Settings::setCSS', [AdministrationSettingsController::class, 'setCSS']); +Route::post('/Settings::setJS', [AdministrationSettingsController::class, 'setJS']); +Route::post('/Settings::getAll', [AdministrationSettingsController::class, 'getAll']); +Route::post('/Settings::saveAll', [AdministrationSettingsController::class, 'saveAll']); +Route::post('/Settings::setAlbumDecoration', [AdministrationSettingsController::class, 'setAlbumDecoration']); +Route::post('/Settings::setOverlayType', [AdministrationSettingsController::class, 'setImageOverlayType']); +Route::post('/Settings::setNSFWVisible', [AdministrationSettingsController::class, 'setNSFWVisible']); +Route::post('/Settings::setDropboxKey', [AdministrationSettingsController::class, 'setDropboxKey']); +Route::post('/Settings::setNewPhotosNotification', [AdministrationSettingsController::class, 'setNewPhotosNotification']); +Route::post('/Settings::setSmartAlbumVisibility', [AdministrationSettingsController::class, 'setSmartAlbumVisibility']); /** * UPDATE. */ -Route::post('/Update::apply', [Administration\UpdateController::class, 'apply']); -Route::post('/Update::check', [Administration\UpdateController::class, 'check']); +Route::post('/Update::apply', [AdministrationUpdateController::class, 'apply']); +Route::post('/Update::check', [AdministrationUpdateController::class, 'check']); diff --git a/routes/web-admin.php b/routes/web-admin.php index 0302e3e0651..86145819106 100644 --- a/routes/web-admin.php +++ b/routes/web-admin.php @@ -2,7 +2,11 @@ namespace App\Http\Controllers\Administration; -use App\Http\Controllers\IndexController; +use App\Legacy\V1\Controllers\Administration\DiagnosticsController; +use App\Legacy\V1\Controllers\Administration\JobController; +use App\Legacy\V1\Controllers\Administration\OptimizeController; +use App\Legacy\V1\Controllers\Administration\UpdateController; +use App\Legacy\V1\Controllers\IndexController; use Illuminate\Support\Facades\Route; /* diff --git a/routes/web-livewire.php b/routes/web-livewire.php index 6ba20284623..76a93408bfe 100644 --- a/routes/web-livewire.php +++ b/routes/web-livewire.php @@ -5,7 +5,7 @@ use App\Assets\Features; use App\Enum\OauthProvidersType; use App\Http\Controllers\Oauth; -use App\Http\Controllers\RedirectController; +use App\Legacy\V1\Controllers\RedirectController; use App\Livewire\Components\Pages\Gallery\Album; use App\Livewire\Components\Pages\Gallery\Albums; use App\Livewire\Components\Pages\Gallery\Search; diff --git a/routes/web.php b/routes/web.php index f725f6e776c..3b95d1222e4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,8 +3,10 @@ namespace App\Http\Controllers; use App\Assets\Features; +use App\Legacy\V1\Controllers\Administration\UpdateController; +use App\Legacy\V1\Controllers\IndexController; +use App\Legacy\V1\Controllers\RedirectController; use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\URL; /* |-------------------------------------------------------------------------- @@ -22,11 +24,11 @@ if (!Features::active('livewire')) { Route::get('/', [IndexController::class, 'show'])->name('home')->middleware(['migration:complete']); Route::get('/gallery', [IndexController::class, 'gallery'])->name('gallery')->middleware(['migration:complete']); - Route::get('/view', [IndexController::class, 'view'])->name('view')->middleware(['redirect-legacy-id']); + Route::get('/view', [IndexController::class, 'view'])->name('view'); Route::get('/frame', [IndexController::class, 'frame'])->name('frame')->middleware(['migration:complete']); } -Route::match(['get', 'post'], '/migrate', [Administration\UpdateController::class, 'migrate']) +Route::match(['get', 'post'], '/migrate', [UpdateController::class, 'migrate']) ->name('migrate') ->middleware(['migration:incomplete']); diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 648cb83cf4c..17a4ef489d0 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -23,8 +23,8 @@ use function Safe\copy; use function Safe\json_decode; use function Safe\tempnam; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\Traits\CatchFailures; +use Tests\Constants\TestConstants; +use Tests\Traits\CatchFailures; abstract class AbstractTestCase extends BaseTestCase { diff --git a/tests/Feature/Constants/TestConstants.php b/tests/Constants/TestConstants.php similarity index 99% rename from tests/Feature/Constants/TestConstants.php rename to tests/Constants/TestConstants.php index 0236f446e71..fa5dfbc9861 100644 --- a/tests/Feature/Constants/TestConstants.php +++ b/tests/Constants/TestConstants.php @@ -1,6 +1,6 @@ root_album_tests->getPositionData(); - /** @var \App\Http\Resources\Collections\PositionDataResource $positionData */ + /** @var \App\Legacy\V1\Resources\Collections\PositionDataResource $positionData */ $positionData = static::convertJsonToObject($positionDataResponse); static::assertIsObject($positionData); static::assertTrue(property_exists($positionData, 'photos')); @@ -163,7 +163,7 @@ public function testGeo(): void Configs::set(TestConstants::CONFIG_MAP_DISPLAY, true); static::assertEquals(true, Configs::getValueAsBool(TestConstants::CONFIG_MAP_DISPLAY)); $positionDataResponse = $this->albums_tests->getPositionData($albumID, false); - /** @var \App\Http\Resources\Collections\PositionDataResource $positionData */ + /** @var \App\Legacy\V1\Resources\Collections\PositionDataResource $positionData */ $positionData = static::convertJsonToObject($positionDataResponse); static::assertIsObject($positionData); static::assertTrue(property_exists($positionData, 'photos')); diff --git a/tests/Feature/GitRemoteTest.php b/tests/Feature_v1/GitRemoteTest.php similarity index 98% rename from tests/Feature/GitRemoteTest.php rename to tests/Feature_v1/GitRemoteTest.php index 196f3b82b90..2b6c1793f62 100644 --- a/tests/Feature/GitRemoteTest.php +++ b/tests/Feature_v1/GitRemoteTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Metadata\Versions\Remote\GitCommits; use App\Metadata\Versions\Remote\GitTags; diff --git a/tests/Feature/HelpersUnitTest.php b/tests/Feature_v1/HelpersUnitTest.php similarity index 97% rename from tests/Feature/HelpersUnitTest.php rename to tests/Feature_v1/HelpersUnitTest.php index c42202f6235..b301916b1fa 100644 --- a/tests/Feature/HelpersUnitTest.php +++ b/tests/Feature_v1/HelpersUnitTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Facades\Helpers; use Tests\AbstractTestCase; diff --git a/tests/Feature/HoneyPotTest.php b/tests/Feature_v1/HoneyPotTest.php similarity index 98% rename from tests/Feature/HoneyPotTest.php rename to tests/Feature_v1/HoneyPotTest.php index 5866f039553..a9cad2c23aa 100644 --- a/tests/Feature/HoneyPotTest.php +++ b/tests/Feature_v1/HoneyPotTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use Illuminate\Http\Response; use Tests\AbstractTestCase; diff --git a/tests/Feature/IndexTest.php b/tests/Feature_v1/IndexTest.php similarity index 81% rename from tests/Feature/IndexTest.php rename to tests/Feature_v1/IndexTest.php index 7452f5c0bb8..4fdee67dbf6 100644 --- a/tests/Feature/IndexTest.php +++ b/tests/Feature_v1/IndexTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\Configs; use Illuminate\Support\Facades\Auth; @@ -19,6 +19,19 @@ class IndexTest extends AbstractTestCase { + private bool $configVueJs; + + public function before(): void + { + $this->configVueJs = config('feature.vuejs'); + config(['feature.vuejs' => false]); + } + + public function after(): void + { + config(['feature.vuejs' => $this->configVueJs]); + } + /** * Testing the Login interface. * @@ -30,7 +43,7 @@ public function testHome(): void * check if we can actually get a nice answer. */ $response = $this->get('/'); - if (config('app.livewire') === true) { + if (config('feature.livewire') === true) { $this->assertRedirect($response); $response->assertRedirect(route('livewire-gallery')); } else { @@ -61,7 +74,7 @@ public function testLandingPage(): void Configs::set('landing_page_enable', 1); $response = $this->get('/'); - if (config('app.livewire') === true) { + if (config('feature.livewire') === true) { $this->assertRedirect($response); $response->assertRedirect(route('landing')); } else { diff --git a/tests/Feature/InstallTest.php b/tests/Feature_v1/InstallTest.php similarity index 92% rename from tests/Feature/InstallTest.php rename to tests/Feature_v1/InstallTest.php index 5258aefd5ea..aa7d96dcbbc 100644 --- a/tests/Feature/InstallTest.php +++ b/tests/Feature_v1/InstallTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\Configs; use App\Models\User; @@ -23,6 +23,19 @@ class InstallTest extends AbstractTestCase { + private bool $configVueJs; + + public function before(): void + { + $this->configVueJs = config('feature.vuejs'); + config(['feature.vuejs' => false]); + } + + public function after(): void + { + config(['feature.vuejs' => $this->configVueJs]); + } + /** * Testing the Login interface. * @@ -41,7 +54,7 @@ public function testInstall(): void config(['app.key' => $prevAppKey]); $response = $this->get('/'); - if (config('app.livewire') === true) { + if (config('feature.livewire') === true) { $this->assertRedirect($response); $response->assertRedirect(route('livewire-gallery')); } else { @@ -138,7 +151,7 @@ public function testInstall(): void */ Configs::invalidateCache(); $response = $this->get('/'); - if (config('app.livewire') === true) { + if (config('feature.livewire') === true) { $this->assertRedirect($response); $response->assertRedirect(route('livewire-gallery')); } else { diff --git a/tests/Feature/LangTest.php b/tests/Feature_v1/LangTest.php similarity index 91% rename from tests/Feature/LangTest.php rename to tests/Feature_v1/LangTest.php index 1d04c68a47d..47a7824feca 100644 --- a/tests/Feature/LangTest.php +++ b/tests/Feature_v1/LangTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use function Safe\scandir; use Symfony\Component\Console\Output\ConsoleOutput; @@ -29,6 +29,7 @@ class LangTest extends AbstractTestCase */ public function testLanguageConsistency(): void { + /** @disregard P1013 */ static::assertEquals('en', app()->getLocale()); static::assertEquals('OK', __('lychee.SUCCESS')); @@ -38,7 +39,7 @@ public function testLanguageConsistency(): void $englishDictionaries = collect(array_diff(scandir(base_path('lang/en')), ['..', '.']))->filter(fn ($v) => str_ends_with($v, '.php'))->all(); foreach ($englishDictionaries as $dictionaryFile) { $englishDictionary = include base_path('lang/en/' . $dictionaryFile); - $availableDictionaries = array_diff(config('app.supported_locale'), ['en']); + $availableDictionaries = collect(array_diff(config('app.supported_locale'), ['en']))->filter(fn ($v) => is_dir(base_path('lang/' . $v)))->all(); foreach ($availableDictionaries as $locale) { $dictionary = include base_path('lang/' . $locale . '/' . $dictionaryFile); @@ -50,7 +51,9 @@ public function testLanguageConsistency(): void public function testEnglishAsFallbackIfLangConfigIsMissing(): void { + /** @disregard P1013 */ app()->setLocale('ZK'); + /** @disregard P1013 */ static::assertEquals('ZK', app()->getLocale()); static::assertEquals('OK', __('lychee.SUCCESS')); } diff --git a/tests/Feature/LegacyTest.php b/tests/Feature_v1/LegacyTest.php similarity index 86% rename from tests/Feature/LegacyTest.php rename to tests/Feature_v1/LegacyTest.php index a924ca8a4d6..0bf63fa0ee2 100644 --- a/tests/Feature/LegacyTest.php +++ b/tests/Feature_v1/LegacyTest.php @@ -10,19 +10,19 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\Album; use App\Models\Photo; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\LibUnitTests\AlbumsUnitTest; -use Tests\Feature\LibUnitTests\PhotosUnitTest; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyPhotos; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\LibUnitTests\AlbumsUnitTest; +use Tests\Feature_v1\LibUnitTests\PhotosUnitTest; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyPhotos; +use Tests\Traits\RequiresEmptyUsers; class LegacyTest extends AbstractTestCase { diff --git a/tests/Feature/LibUnitTests/AlbumsUnitTest.php b/tests/Feature_v1/LibUnitTests/AlbumsUnitTest.php similarity index 99% rename from tests/Feature/LibUnitTests/AlbumsUnitTest.php rename to tests/Feature_v1/LibUnitTests/AlbumsUnitTest.php index 723c59d0660..16b8d3f6539 100644 --- a/tests/Feature/LibUnitTests/AlbumsUnitTest.php +++ b/tests/Feature_v1/LibUnitTests/AlbumsUnitTest.php @@ -10,12 +10,12 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use Illuminate\Testing\TestResponse; use Symfony\Component\HttpFoundation\StreamedResponse; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class AlbumsUnitTest { diff --git a/tests/Feature/LibUnitTests/AssertableZipArchive.php b/tests/Feature_v1/LibUnitTests/AssertableZipArchive.php similarity index 98% rename from tests/Feature/LibUnitTests/AssertableZipArchive.php rename to tests/Feature_v1/LibUnitTests/AssertableZipArchive.php index 17fc580255a..e25dacf4cc7 100644 --- a/tests/Feature/LibUnitTests/AssertableZipArchive.php +++ b/tests/Feature_v1/LibUnitTests/AssertableZipArchive.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use App\Image\Files\InMemoryBuffer; use App\Image\Files\TemporaryLocalFile; diff --git a/tests/Feature/LibUnitTests/PhotosUnitTest.php b/tests/Feature_v1/LibUnitTests/PhotosUnitTest.php similarity index 99% rename from tests/Feature/LibUnitTests/PhotosUnitTest.php rename to tests/Feature_v1/LibUnitTests/PhotosUnitTest.php index 48f1efd8ffd..fb29220fd42 100644 --- a/tests/Feature/LibUnitTests/PhotosUnitTest.php +++ b/tests/Feature_v1/LibUnitTests/PhotosUnitTest.php @@ -10,13 +10,13 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use Illuminate\Http\UploadedFile; use Illuminate\Testing\TestResponse; use Symfony\Component\HttpFoundation\StreamedResponse; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class PhotosUnitTest { diff --git a/tests/Feature/LibUnitTests/RootAlbumUnitTest.php b/tests/Feature_v1/LibUnitTests/RootAlbumUnitTest.php similarity index 96% rename from tests/Feature/LibUnitTests/RootAlbumUnitTest.php rename to tests/Feature_v1/LibUnitTests/RootAlbumUnitTest.php index 147b9dd5154..438449bd761 100644 --- a/tests/Feature/LibUnitTests/RootAlbumUnitTest.php +++ b/tests/Feature_v1/LibUnitTests/RootAlbumUnitTest.php @@ -10,11 +10,11 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use Illuminate\Testing\TestResponse; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class RootAlbumUnitTest { diff --git a/tests/Feature/LibUnitTests/SessionUnitTest.php b/tests/Feature_v1/LibUnitTests/SessionUnitTest.php similarity index 97% rename from tests/Feature/LibUnitTests/SessionUnitTest.php rename to tests/Feature_v1/LibUnitTests/SessionUnitTest.php index f8648f69a67..7f5c003764a 100644 --- a/tests/Feature/LibUnitTests/SessionUnitTest.php +++ b/tests/Feature_v1/LibUnitTests/SessionUnitTest.php @@ -10,11 +10,11 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use Illuminate\Testing\TestResponse; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class SessionUnitTest { diff --git a/tests/Feature/LibUnitTests/SharingUnitTest.php b/tests/Feature_v1/LibUnitTests/SharingUnitTest.php similarity index 95% rename from tests/Feature/LibUnitTests/SharingUnitTest.php rename to tests/Feature_v1/LibUnitTests/SharingUnitTest.php index 6d6d1648ade..988458ce8f1 100644 --- a/tests/Feature/LibUnitTests/SharingUnitTest.php +++ b/tests/Feature_v1/LibUnitTests/SharingUnitTest.php @@ -10,11 +10,11 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use Illuminate\Testing\TestResponse; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class SharingUnitTest { diff --git a/tests/Feature/LibUnitTests/UsersUnitTest.php b/tests/Feature_v1/LibUnitTests/UsersUnitTest.php similarity index 98% rename from tests/Feature/LibUnitTests/UsersUnitTest.php rename to tests/Feature_v1/LibUnitTests/UsersUnitTest.php index c806d836caa..dba80d8707d 100644 --- a/tests/Feature/LibUnitTests/UsersUnitTest.php +++ b/tests/Feature_v1/LibUnitTests/UsersUnitTest.php @@ -10,11 +10,11 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature\LibUnitTests; +namespace Tests\Feature_v1\LibUnitTests; use Illuminate\Testing\TestResponse; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class UsersUnitTest { diff --git a/tests/Feature/LogsTest.php b/tests/Feature_v1/LogsTest.php similarity index 95% rename from tests/Feature/LogsTest.php rename to tests/Feature_v1/LogsTest.php index c89acafa438..f9e42d2aaa4 100644 --- a/tests/Feature/LogsTest.php +++ b/tests/Feature_v1/LogsTest.php @@ -10,14 +10,14 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\User; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class LogsTest extends AbstractTestCase { diff --git a/tests/Feature/NotificationTest.php b/tests/Feature_v1/NotificationTest.php similarity index 90% rename from tests/Feature/NotificationTest.php rename to tests/Feature_v1/NotificationTest.php index aa3a66783ba..c09dee7363a 100644 --- a/tests/Feature/NotificationTest.php +++ b/tests/Feature_v1/NotificationTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Mail\PhotosAdded; use App\Models\Configs; @@ -18,13 +18,13 @@ use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\LibUnitTests\AlbumsUnitTest; -use Tests\Feature\LibUnitTests\PhotosUnitTest; -use Tests\Feature\LibUnitTests\UsersUnitTest; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyPhotos; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\LibUnitTests\AlbumsUnitTest; +use Tests\Feature_v1\LibUnitTests\PhotosUnitTest; +use Tests\Feature_v1\LibUnitTests\UsersUnitTest; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyPhotos; +use Tests\Traits\RequiresEmptyUsers; class NotificationTest extends AbstractTestCase { diff --git a/tests/Feature/OptimizeTest.php b/tests/Feature_v1/OptimizeTest.php similarity index 92% rename from tests/Feature/OptimizeTest.php rename to tests/Feature_v1/OptimizeTest.php index da6f4c3f5c4..c606e8755a9 100644 --- a/tests/Feature/OptimizeTest.php +++ b/tests/Feature_v1/OptimizeTest.php @@ -10,12 +10,12 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class OptimizeTest extends AbstractTestCase { diff --git a/tests/Feature/PhotosAddHandlerGDTest.php b/tests/Feature_v1/PhotosAddHandlerGDTest.php similarity index 90% rename from tests/Feature/PhotosAddHandlerGDTest.php rename to tests/Feature_v1/PhotosAddHandlerGDTest.php index ccc85a1fc4e..4363f854a7d 100644 --- a/tests/Feature/PhotosAddHandlerGDTest.php +++ b/tests/Feature_v1/PhotosAddHandlerGDTest.php @@ -10,12 +10,12 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use Tests\AbstractTestCase; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\Traits\InteractsWithRaw; -use Tests\Feature\Traits\RequiresImageHandler; +use Tests\Constants\TestConstants; +use Tests\Traits\InteractsWithRaw; +use Tests\Traits\RequiresImageHandler; /** * Runs the tests of {@link PhotosAddHandlerTestAbstract} with GD as image handler. diff --git a/tests/Feature/PhotosAddHandlerImagickTest.php b/tests/Feature_v1/PhotosAddHandlerImagickTest.php similarity index 90% rename from tests/Feature/PhotosAddHandlerImagickTest.php rename to tests/Feature_v1/PhotosAddHandlerImagickTest.php index b665cd69b26..79e104eeb6b 100644 --- a/tests/Feature/PhotosAddHandlerImagickTest.php +++ b/tests/Feature_v1/PhotosAddHandlerImagickTest.php @@ -10,12 +10,12 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use Tests\AbstractTestCase; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\Traits\InteractsWithRaw; -use Tests\Feature\Traits\RequiresImageHandler; +use Tests\Constants\TestConstants; +use Tests\Traits\InteractsWithRaw; +use Tests\Traits\RequiresImageHandler; /** * Runs the tests of {@link PhotosAddHandlerTestAbstract} with Imagick as image handler. diff --git a/tests/Feature/PhotosAddMethodsTest.php b/tests/Feature_v1/PhotosAddMethodsTest.php similarity index 99% rename from tests/Feature/PhotosAddMethodsTest.php rename to tests/Feature_v1/PhotosAddMethodsTest.php index 949d8a6d5aa..0441bf22fc5 100644 --- a/tests/Feature/PhotosAddMethodsTest.php +++ b/tests/Feature_v1/PhotosAddMethodsTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Image\Files\BaseMediaFile; use App\Jobs\ProcessImageJob; @@ -22,8 +22,8 @@ use Illuminate\Support\Facades\Queue; use function Safe\copy; use Tests\AbstractTestCase; -use Tests\Feature\Base\BasePhotoTest; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BasePhotoTest; /** * Contains all tests for the various ways of adding images to Lychee diff --git a/tests/Feature/PhotosAddNegativeTest.php b/tests/Feature_v1/PhotosAddNegativeTest.php similarity index 95% rename from tests/Feature/PhotosAddNegativeTest.php rename to tests/Feature_v1/PhotosAddNegativeTest.php index 4bbc0333627..8c060ac1b4e 100644 --- a/tests/Feature/PhotosAddNegativeTest.php +++ b/tests/Feature_v1/PhotosAddNegativeTest.php @@ -10,16 +10,16 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use function Safe\chmod; use function Safe\copy; use function Safe\scandir; use Tests\AbstractTestCase; -use Tests\Feature\Base\BasePhotoTest; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\Traits\InteractsWithFilesystemPermissions; -use Tests\Feature\Traits\InteractsWithRaw; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BasePhotoTest; +use Tests\Traits\InteractsWithFilesystemPermissions; +use Tests\Traits\InteractsWithRaw; /** * Contains all tests which add photos to Lychee and are expected to fail. diff --git a/tests/Feature/PhotosAddSpecialAlbumTest.php b/tests/Feature_v1/PhotosAddSpecialAlbumTest.php similarity index 94% rename from tests/Feature/PhotosAddSpecialAlbumTest.php rename to tests/Feature_v1/PhotosAddSpecialAlbumTest.php index da507bc1029..297634be072 100644 --- a/tests/Feature/PhotosAddSpecialAlbumTest.php +++ b/tests/Feature_v1/PhotosAddSpecialAlbumTest.php @@ -10,14 +10,14 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\SmartAlbums\RecentAlbum; use App\SmartAlbums\StarredAlbum; use Tests\AbstractTestCase; -use Tests\Feature\Base\BasePhotoTest; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\Traits\InteractWithSmartAlbums; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BasePhotoTest; +use Tests\Traits\InteractWithSmartAlbums; /** * Contains tests which add photos to Lychee and directly set an album. diff --git a/tests/Feature/PhotosDownloadTest.php b/tests/Feature_v1/PhotosDownloadTest.php similarity index 97% rename from tests/Feature/PhotosDownloadTest.php rename to tests/Feature_v1/PhotosDownloadTest.php index dd0095fc355..e5cd9c7236a 100644 --- a/tests/Feature/PhotosDownloadTest.php +++ b/tests/Feature_v1/PhotosDownloadTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Enum\DownloadVariantType; use App\Image\Files\InMemoryBuffer; @@ -25,12 +25,12 @@ use function Safe\fwrite; use Symfony\Component\HttpFoundation\HeaderUtils; use Tests\AbstractTestCase; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\LibUnitTests\AssertableZipArchive; -use Tests\Feature\LibUnitTests\SharingUnitTest; -use Tests\Feature\LibUnitTests\UsersUnitTest; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\LibUnitTests\AssertableZipArchive; +use Tests\Feature_v1\LibUnitTests\SharingUnitTest; +use Tests\Feature_v1\LibUnitTests\UsersUnitTest; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyUsers; class PhotosDownloadTest extends Base\BasePhotoTest { diff --git a/tests/Feature/PhotosOperationsTest.php b/tests/Feature_v1/PhotosOperationsTest.php similarity index 97% rename from tests/Feature/PhotosOperationsTest.php rename to tests/Feature_v1/PhotosOperationsTest.php index 21ee38e2129..128712e2010 100644 --- a/tests/Feature/PhotosOperationsTest.php +++ b/tests/Feature_v1/PhotosOperationsTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Exceptions\Internal\IllegalOrderOfOperationException; use App\Exceptions\Internal\NotImplementedException; @@ -23,14 +23,14 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\Base\BasePhotoTest; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\LibUnitTests\RootAlbumUnitTest; -use Tests\Feature\LibUnitTests\SharingUnitTest; -use Tests\Feature\LibUnitTests\UsersUnitTest; -use Tests\Feature\Traits\InteractWithSmartAlbums; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BasePhotoTest; +use Tests\Feature_v1\LibUnitTests\RootAlbumUnitTest; +use Tests\Feature_v1\LibUnitTests\SharingUnitTest; +use Tests\Feature_v1\LibUnitTests\UsersUnitTest; +use Tests\Traits\InteractWithSmartAlbums; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyUsers; class PhotosOperationsTest extends BasePhotoTest { diff --git a/tests/Feature/PhotosRotateGDTest.php b/tests/Feature_v1/PhotosRotateGDTest.php similarity index 85% rename from tests/Feature/PhotosRotateGDTest.php rename to tests/Feature_v1/PhotosRotateGDTest.php index 8ce5b7f5f6b..cf476d7f771 100644 --- a/tests/Feature/PhotosRotateGDTest.php +++ b/tests/Feature_v1/PhotosRotateGDTest.php @@ -10,10 +10,10 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; -use Tests\Feature\Base\BasePhotosRotateTest; -use Tests\Feature\Traits\RequiresImageHandler; +use Tests\Feature_v1\Base\BasePhotosRotateTest; +use Tests\Traits\RequiresImageHandler; /** * Runs the tests of {@link PhotosRotateTestAbstract} with GD as image handler. diff --git a/tests/Feature/PhotosRotateImagickTest.php b/tests/Feature_v1/PhotosRotateImagickTest.php similarity index 85% rename from tests/Feature/PhotosRotateImagickTest.php rename to tests/Feature_v1/PhotosRotateImagickTest.php index cee2536d5b8..773a6269b84 100644 --- a/tests/Feature/PhotosRotateImagickTest.php +++ b/tests/Feature_v1/PhotosRotateImagickTest.php @@ -10,10 +10,10 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; -use Tests\Feature\Base\BasePhotosRotateTest; -use Tests\Feature\Traits\RequiresImageHandler; +use Tests\Feature_v1\Base\BasePhotosRotateTest; +use Tests\Traits\RequiresImageHandler; /** * Runs the tests of {@link BasePhotosRotateTest} with Imagick as image handler. diff --git a/tests/Feature/RSSTest.php b/tests/Feature_v1/RSSTest.php similarity index 92% rename from tests/Feature/RSSTest.php rename to tests/Feature_v1/RSSTest.php index 645b7fc646b..fae45456028 100644 --- a/tests/Feature/RSSTest.php +++ b/tests/Feature_v1/RSSTest.php @@ -10,16 +10,16 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\Configs; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\LibUnitTests\AlbumsUnitTest; -use Tests\Feature\LibUnitTests\PhotosUnitTest; -use Tests\Feature\Traits\RequiresEmptyPhotos; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\LibUnitTests\AlbumsUnitTest; +use Tests\Feature_v1\LibUnitTests\PhotosUnitTest; +use Tests\Traits\RequiresEmptyPhotos; class RSSTest extends AbstractTestCase { diff --git a/tests/Feature/RedirectTest.php b/tests/Feature_v1/RedirectTest.php similarity index 78% rename from tests/Feature/RedirectTest.php rename to tests/Feature_v1/RedirectTest.php index 50d8ad1ba3c..63d9d77c421 100644 --- a/tests/Feature/RedirectTest.php +++ b/tests/Feature_v1/RedirectTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use Tests\AbstractTestCase; @@ -26,7 +26,11 @@ public function testRedirection(): void $response = $this->get('r/aaaaaaaaaaaaaaaaaaaaaaaa'); $this->assertStatus($response, 302); - $response->assertRedirect('gallery#aaaaaaaaaaaaaaaaaaaaaaaa'); + if (config('feature.livewire') === true) { + $response->assertRedirect('gallery/aaaaaaaaaaaaaaaaaaaaaaaa'); + } else { + $response->assertRedirect('gallery#aaaaaaaaaaaaaaaaaaaaaaaa'); + } $response = $this->get('r/aaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbb'); diff --git a/tests/Feature/RootTest.php b/tests/Feature_v1/RootTest.php similarity index 96% rename from tests/Feature/RootTest.php rename to tests/Feature_v1/RootTest.php index a3e48b6f86b..a15e6c3b2da 100644 --- a/tests/Feature/RootTest.php +++ b/tests/Feature_v1/RootTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use function Safe\exec; use Tests\AbstractTestCase; diff --git a/tests/Feature/SearchTest.php b/tests/Feature_v1/SearchTest.php similarity index 97% rename from tests/Feature/SearchTest.php rename to tests/Feature_v1/SearchTest.php index 03181945512..3dbfcc08c16 100644 --- a/tests/Feature/SearchTest.php +++ b/tests/Feature_v1/SearchTest.php @@ -10,19 +10,19 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\Configs; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Illuminate\Testing\TestResponse; use Tests\AbstractTestCase; -use Tests\Feature\Base\BasePhotoTest; -use Tests\Feature\Constants\TestConstants; -use Tests\Feature\LibUnitTests\SharingUnitTest; -use Tests\Feature\LibUnitTests\UsersUnitTest; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BasePhotoTest; +use Tests\Feature_v1\LibUnitTests\SharingUnitTest; +use Tests\Feature_v1\LibUnitTests\UsersUnitTest; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyUsers; class SearchTest extends BasePhotoTest { diff --git a/tests/Feature/SettingsTest.php b/tests/Feature_v1/SettingsTest.php similarity index 99% rename from tests/Feature/SettingsTest.php rename to tests/Feature_v1/SettingsTest.php index b9e3083b8dd..49e66f27f36 100644 --- a/tests/Feature/SettingsTest.php +++ b/tests/Feature_v1/SettingsTest.php @@ -10,11 +10,11 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Enum\ColumnSortingType; use App\Enum\OrderSortingType; -use App\Http\Requests\Settings\SetSortingSettingsRequest; +use App\Legacy\V1\Requests\Settings\SetSortingSettingsRequest; use App\Models\Configs; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\File; diff --git a/tests/Feature/SharingBasicTest.php b/tests/Feature_v1/SharingBasicTest.php similarity index 95% rename from tests/Feature/SharingBasicTest.php rename to tests/Feature_v1/SharingBasicTest.php index 67e94d39e41..9b40242415b 100644 --- a/tests/Feature/SharingBasicTest.php +++ b/tests/Feature_v1/SharingBasicTest.php @@ -10,10 +10,10 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; -use Tests\Feature\Base\BaseSharingTest; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BaseSharingTest; class SharingBasicTest extends BaseSharingTest { diff --git a/tests/Feature/SharingSpecialTest.php b/tests/Feature_v1/SharingSpecialTest.php similarity index 99% rename from tests/Feature/SharingSpecialTest.php rename to tests/Feature_v1/SharingSpecialTest.php index b6e123442b4..c8843bf80f2 100644 --- a/tests/Feature/SharingSpecialTest.php +++ b/tests/Feature_v1/SharingSpecialTest.php @@ -10,15 +10,15 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\SmartAlbums\OnThisDayAlbum; use App\SmartAlbums\RecentAlbum; use App\SmartAlbums\StarredAlbum; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; -use Tests\Feature\Base\BaseSharingTest; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BaseSharingTest; class SharingSpecialTest extends BaseSharingTest { diff --git a/tests/Feature/SharingWithAnonUserTest.php b/tests/Feature_v1/SharingWithAnonUserTest.php similarity index 99% rename from tests/Feature/SharingWithAnonUserTest.php rename to tests/Feature_v1/SharingWithAnonUserTest.php index 146c1ee2e92..645d6cda3bb 100644 --- a/tests/Feature/SharingWithAnonUserTest.php +++ b/tests/Feature_v1/SharingWithAnonUserTest.php @@ -10,14 +10,14 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\SmartAlbums\OnThisDayAlbum; use App\SmartAlbums\RecentAlbum; use App\SmartAlbums\StarredAlbum; use App\SmartAlbums\UnsortedAlbum; -use Tests\Feature\Base\BaseSharingTestScenarios; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BaseSharingTestScenarios; /** * Implements the tests of {@link BaseSharingTestScenarios} for an diff --git a/tests/Feature/SharingWithNonAdminUserTest.php b/tests/Feature_v1/SharingWithNonAdminUserTest.php similarity index 99% rename from tests/Feature/SharingWithNonAdminUserTest.php rename to tests/Feature_v1/SharingWithNonAdminUserTest.php index acc2d60bf53..e3ca29d2d02 100644 --- a/tests/Feature/SharingWithNonAdminUserTest.php +++ b/tests/Feature_v1/SharingWithNonAdminUserTest.php @@ -10,15 +10,15 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\SmartAlbums\OnThisDayAlbum; use App\SmartAlbums\RecentAlbum; use App\SmartAlbums\StarredAlbum; use App\SmartAlbums\UnsortedAlbum; use Illuminate\Support\Facades\Auth; -use Tests\Feature\Base\BaseSharingTestScenarios; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; +use Tests\Feature_v1\Base\BaseSharingTestScenarios; /** * Implements the tests of {@link BaseSharingTestScenarios} for a diff --git a/tests/Feature/SmartAlbumVisibilityTest.php b/tests/Feature_v1/SmartAlbumVisibilityTest.php similarity index 93% rename from tests/Feature/SmartAlbumVisibilityTest.php rename to tests/Feature_v1/SmartAlbumVisibilityTest.php index 7f638b92fb4..00f985e2534 100644 --- a/tests/Feature/SmartAlbumVisibilityTest.php +++ b/tests/Feature_v1/SmartAlbumVisibilityTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\SmartAlbums\OnThisDayAlbum; use App\SmartAlbums\RecentAlbum; @@ -18,15 +18,15 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; use Tests\AbstractTestCase; -use Tests\Feature\LibUnitTests\AlbumsUnitTest; -use Tests\Feature\LibUnitTests\PhotosUnitTest; -use Tests\Feature\LibUnitTests\RootAlbumUnitTest; -use Tests\Feature\LibUnitTests\SharingUnitTest; -use Tests\Feature\LibUnitTests\UsersUnitTest; -use Tests\Feature\Traits\InteractWithSmartAlbums; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyPhotos; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Feature_v1\LibUnitTests\AlbumsUnitTest; +use Tests\Feature_v1\LibUnitTests\PhotosUnitTest; +use Tests\Feature_v1\LibUnitTests\RootAlbumUnitTest; +use Tests\Feature_v1\LibUnitTests\SharingUnitTest; +use Tests\Feature_v1\LibUnitTests\UsersUnitTest; +use Tests\Traits\InteractWithSmartAlbums; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyPhotos; +use Tests\Traits\RequiresEmptyUsers; class SmartAlbumVisibilityTest extends AbstractTestCase { diff --git a/tests/Feature/UpdateTest.php b/tests/Feature_v1/UpdateTest.php similarity index 98% rename from tests/Feature/UpdateTest.php rename to tests/Feature_v1/UpdateTest.php index 7408eefc377..afa9aa8dfb8 100644 --- a/tests/Feature/UpdateTest.php +++ b/tests/Feature_v1/UpdateTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Exceptions\InsufficientFilesystemPermissions; use App\Models\Configs; @@ -20,7 +20,7 @@ use Illuminate\Support\Facades\Session; use PHPUnit\Framework\ExpectationFailedException; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; +use Tests\Traits\CatchFailures; class UpdateTest extends AbstractTestCase { diff --git a/tests/Feature/UsersTest.php b/tests/Feature_v1/UsersTest.php similarity index 97% rename from tests/Feature/UsersTest.php rename to tests/Feature_v1/UsersTest.php index 4676ba25245..10102be3733 100644 --- a/tests/Feature/UsersTest.php +++ b/tests/Feature_v1/UsersTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\Configs; use App\Models\User; @@ -23,10 +23,10 @@ use PHPUnit\Framework\ExpectationFailedException; use function Safe\json_decode; use Tests\AbstractTestCase; -use Tests\Feature\LibUnitTests\AlbumsUnitTest; -use Tests\Feature\LibUnitTests\SessionUnitTest; -use Tests\Feature\LibUnitTests\UsersUnitTest; -use Tests\Feature\Traits\InteractWithSmartAlbums; +use Tests\Feature_v1\LibUnitTests\AlbumsUnitTest; +use Tests\Feature_v1\LibUnitTests\SessionUnitTest; +use Tests\Feature_v1\LibUnitTests\UsersUnitTest; +use Tests\Traits\InteractWithSmartAlbums; class UsersTest extends AbstractTestCase { diff --git a/tests/Feature/VersionDTOUnitTest.php b/tests/Feature_v1/VersionDTOUnitTest.php similarity index 97% rename from tests/Feature/VersionDTOUnitTest.php rename to tests/Feature_v1/VersionDTOUnitTest.php index 8f6999fcbe4..3ab142ad804 100644 --- a/tests/Feature/VersionDTOUnitTest.php +++ b/tests/Feature_v1/VersionDTOUnitTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\DTO\Version; use App\Exceptions\Internal\LycheeInvalidArgumentException; diff --git a/tests/Feature/WebAuthTest.php b/tests/Feature_v1/WebAuthTest.php similarity index 99% rename from tests/Feature/WebAuthTest.php rename to tests/Feature_v1/WebAuthTest.php index f1dedea0299..67ffac3a346 100644 --- a/tests/Feature/WebAuthTest.php +++ b/tests/Feature_v1/WebAuthTest.php @@ -10,7 +10,7 @@ * @noinspection PhpUnhandledExceptionInspection */ -namespace Tests\Feature; +namespace Tests\Feature_v1; use App\Models\User; use Illuminate\Support\Facades\Auth; @@ -18,8 +18,8 @@ use Laragear\WebAuthn\ByteBuffer; use Laragear\WebAuthn\Challenge; use Tests\AbstractTestCase; -use Tests\Feature\Traits\CatchFailures; -use Tests\Feature\Traits\RequiresEmptyWebAuthnCredentials; +use Tests\Traits\CatchFailures; +use Tests\Traits\RequiresEmptyWebAuthnCredentials; class WebAuthTest extends AbstractTestCase { diff --git a/tests/Livewire/Base/BaseLivewireTest.php b/tests/Livewire/Base/BaseLivewireTest.php index c06fd63296a..64074acfb61 100644 --- a/tests/Livewire/Base/BaseLivewireTest.php +++ b/tests/Livewire/Base/BaseLivewireTest.php @@ -18,9 +18,9 @@ use App\Models\User; use Illuminate\Foundation\Testing\DatabaseTransactions; use Tests\AbstractTestCase; -use Tests\Feature\Traits\RequiresEmptyAlbums; -use Tests\Feature\Traits\RequiresEmptyPhotos; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Traits\RequiresEmptyAlbums; +use Tests\Traits\RequiresEmptyPhotos; +use Tests\Traits\RequiresEmptyUsers; abstract class BaseLivewireTest extends AbstractTestCase { diff --git a/tests/Livewire/Forms/FormsProfileTest.php b/tests/Livewire/Forms/FormsProfileTest.php index 27145d392e5..2dfa09942c5 100644 --- a/tests/Livewire/Forms/FormsProfileTest.php +++ b/tests/Livewire/Forms/FormsProfileTest.php @@ -19,8 +19,8 @@ use App\Livewire\Components\Forms\Profile\SetLogin; use Laragear\WebAuthn\Models\WebAuthnCredential; use Livewire\Livewire; -use Tests\Feature\Traits\RequiresEmptyWebAuthnCredentials; use Tests\Livewire\Base\BaseLivewireTest; +use Tests\Traits\RequiresEmptyWebAuthnCredentials; class FormsProfileTest extends BaseLivewireTest { diff --git a/tests/Livewire/Forms/ImportFromDropBoxTest.php b/tests/Livewire/Forms/ImportFromDropBoxTest.php index 23239858b02..1e310406cb2 100644 --- a/tests/Livewire/Forms/ImportFromDropBoxTest.php +++ b/tests/Livewire/Forms/ImportFromDropBoxTest.php @@ -15,7 +15,7 @@ use App\Livewire\Components\Forms\Add\ImportFromDropbox; use Illuminate\Foundation\Testing\DatabaseTransactions; use Livewire\Livewire; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; use Tests\Livewire\Base\BaseLivewireTest; class ImportFromDropBoxTest extends BaseLivewireTest diff --git a/tests/Livewire/Forms/ImportFromUrlTest.php b/tests/Livewire/Forms/ImportFromUrlTest.php index e9f376d6540..624c3a3e45e 100644 --- a/tests/Livewire/Forms/ImportFromUrlTest.php +++ b/tests/Livewire/Forms/ImportFromUrlTest.php @@ -15,7 +15,7 @@ use App\Livewire\Components\Forms\Add\ImportFromUrl; use Illuminate\Foundation\Testing\DatabaseTransactions; use Livewire\Livewire; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; use Tests\Livewire\Base\BaseLivewireTest; class ImportFromUrlTest extends BaseLivewireTest diff --git a/tests/Livewire/Forms/UploadTest.php b/tests/Livewire/Forms/UploadTest.php index 1c6f5d1c09f..7e0873df183 100644 --- a/tests/Livewire/Forms/UploadTest.php +++ b/tests/Livewire/Forms/UploadTest.php @@ -20,7 +20,7 @@ use function Safe\file_get_contents; use function Safe\filesize; use function Safe\tempnam; -use Tests\Feature\Constants\TestConstants; +use Tests\Constants\TestConstants; use Tests\Livewire\Base\BaseLivewireTest; class UploadTest extends BaseLivewireTest diff --git a/tests/Livewire/Pages/SettingsTest.php b/tests/Livewire/Pages/SettingsTest.php index 6530a411a4b..658e8b2804c 100644 --- a/tests/Livewire/Pages/SettingsTest.php +++ b/tests/Livewire/Pages/SettingsTest.php @@ -14,8 +14,8 @@ use App\Livewire\Components\Pages\Settings; use Livewire\Livewire; -use Tests\Feature\Traits\RequiresEmptyUsers; use Tests\Livewire\Base\BaseLivewireTest; +use Tests\Traits\RequiresEmptyUsers; class SettingsTest extends BaseLivewireTest { diff --git a/tests/Livewire/Pages/UsersTest.php b/tests/Livewire/Pages/UsersTest.php index 41e8a491e63..d025dfc0cd6 100644 --- a/tests/Livewire/Pages/UsersTest.php +++ b/tests/Livewire/Pages/UsersTest.php @@ -16,7 +16,7 @@ use App\Models\User; use Livewire\Livewire; use Tests\AbstractTestCase; -use Tests\Feature\Traits\RequiresEmptyUsers; +use Tests\Traits\RequiresEmptyUsers; class UsersTest extends AbstractTestCase { diff --git a/tests/Feature/Traits/CatchFailures.php b/tests/Traits/CatchFailures.php similarity index 98% rename from tests/Feature/Traits/CatchFailures.php rename to tests/Traits/CatchFailures.php index db21c1367ab..46d0337bf09 100644 --- a/tests/Feature/Traits/CatchFailures.php +++ b/tests/Traits/CatchFailures.php @@ -1,6 +1,6 @@