diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5728c5df..7558ee011 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,9 @@ jobs: strategy: matrix: container: [ - "kirschbaumdevelopment/laravel-test-runner:8.2", - "kirschbaumdevelopment/laravel-test-runner:8.3" + "kirschbaumdevelopment/laravel-test-runner:8.3", + "kirschbaumdevelopment/laravel-test-runner:8.4", + "kirschbaumdevelopment/laravel-test-runner:8.5" ] container: diff --git a/.gitignore b/.gitignore index 18cecf996..13db171a8 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ resources/views/vendor/ composer.lock phpunit.xml +/.phpunit.cache diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index e07b8d8c1..b5bf0d871 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.12","version":"3.13.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"no_empty_statement":true,"no_useless_return":true,"not_operator_with_successor_space":true,"explicit_string_variable":true,"simple_to_complex_string_variable":true,"array_indentation":true,"blank_line_before_statement":{"statements":["case","default","declare","do","goto","if","include","include_once","require","require_once","switch","try"]}},"hashes":{"routes\/console.php":"043de8d2168ad1c2f19f1f32431ca640","routes\/api.php":"1cfef62d42fc585043690f50f0d7816f","routes\/web.php":"765479749fce08c21ce3c82878dc68e5","routes\/channels.php":"edadd8dfa4a96a42dde09f4ba1362bbd","database\/seeders\/DatabaseSeeder.php":"863fc820d5b1b26b07ff78678e75c600","database\/factories\/UserFactory.php":"14bb2790d699e4c12d3c921413397816","database\/factories\/InvitationFactory.php":"5d7806ef7213f9b8d0ccb1a67572c1c2","database\/factories\/ApiTokenFactory.php":"39a07fd93703811c1e8138c90f617cc5","database\/factories\/WorkspaceFactory.php":"8eb260ed12b4aeef9662731f5f927524","database\/migrations\/2014_10_12_000000_create_users_table.php":"6f6305c9621dc43a7e4e67692f74823a","database\/migrations\/2019_08_19_000000_create_failed_jobs_table.php":"2d2101455252f967fc9f40bdfd44c96f","database\/migrations\/2017_04_11_100000_create_invitations_table.php":"4498012dc9968cfbe113a08f39ee14da","database\/migrations\/2021_01_26_151747_remove_api_token_from_users_table.php":"768971eed7996a173e67e9367cab22ef","database\/migrations\/2019_08_24_114758_adjust_users_table.php":"8a5aee2cd552991b28f0d9633d54efe9","database\/migrations\/2017_04_11_000000_create_workspaces_table.php":"523915ba995bcc529a38261248825b82","database\/migrations\/2020_11_13_120125_create_api_tokens_table.php":"7ee00241a111ac86e6ce713f220dfa0c","database\/migrations\/2014_10_12_100000_create_password_resets_table.php":"6a565de52ad5c704c0a50d9da2dce231","app\/Providers\/EventServiceProvider.php":"34a080e907226081e6958d8e1611101e","app\/Providers\/AppServiceProvider.php":"238832fb41ec4d01ea13a4e3d8688b1f","app\/Providers\/BroadcastServiceProvider.php":"0ee72a104b9018e848f386a2d425bd36","app\/Providers\/HorizonServiceProvider.php":"7b22e94cc33bfe5edadd55ddbb24bbf8","app\/Providers\/AuthServiceProvider.php":"e6e625536689ce1bf6cfa9a02e66457f","app\/Providers\/RouteServiceProvider.php":"89a38040e0eb44cbd3c9fd286eb55f39","app\/Setup\/WritesToEnvironment.php":"b44dd1d8d356f69bb27369f59de68296","app\/Setup\/Migrations.php":"442db278c9932e2729addf6e619e01d6","app\/Setup\/Admin.php":"e4685eb3e4243ccf9131cd1a11bfe1a3","app\/Setup\/Env.php":"b93a8f6fe59cc983f49f3c8cc33bc064","app\/Setup\/Database.php":"39161becadde353e1bd8b8f4e2afebdb","app\/Setup\/Key.php":"611620a7586d5319931c3aab0801e66a","app\/Setup\/Url.php":"462d49f15cb5b38e81cd41b479f520c2","app\/Setup\/StepInterface.php":"95ef7030278de820339ab94bbbbbf231","app\/Models\/User.php":"4a2f6361032921bc17bbea9d540b3527","app\/Models\/ApiToken.php":"24bb163dec324c56b5a763f6e473671b","app\/Models\/Invitation.php":"5f1116032f469de07b258c28a04d2630","app\/Models\/Workspace.php":"d1ea509954f2474880e6074aada00b91","app\/Livewire\/Setup.php":"1e1c86301c8c7f0b2a128e90d5c203a6","app\/Http\/Middleware\/Authenticate.php":"1a28ab8a480d33b5e262412c084e77b2","app\/Http\/Middleware\/TrustProxies.php":"80202bd7bf4c31e901f1043346b82dad","app\/Http\/Middleware\/LocaleMiddleware.php":"1386bc4ac32df382c5631101b0f9339e","app\/Http\/Middleware\/VerifyCsrfToken.php":"707f8a5975d94d67dc2e9f5b6c561cef","app\/Http\/Middleware\/RequireWorkspace.php":"410b7682a4f21bfb81143d6469eaaa77","app\/Http\/Middleware\/EncryptCookies.php":"f6f49f8cb83225155ebe207c0eb24c18","app\/Http\/Middleware\/RedirectIfAuthenticated.php":"ddbd033d07f29b97941e2e021a78eab4","app\/Http\/Middleware\/OwnsRequestedWorkspace.php":"99b3eb77cb33c12f4630f0ff0bf0a84e","app\/Http\/Middleware\/OwnsCurrentWorkspace.php":"ddd644de44de55bed0d14a058534da5f","app\/Http\/Middleware\/CheckForMaintenanceMode.php":"13fecdea17d95ffe8f70fe3c56e0f497","app\/Http\/Middleware\/TrustHosts.php":"181bdfdfebffb2e8019806a7b3c061bd","app\/Http\/Middleware\/TrimStrings.php":"6147464a2cd11a9b32189c718f3e1fa5","app\/Http\/Controllers\/Auth\/ApiTokenController.php":"422df9c575b44baa0dd4554037164745","app\/Http\/Controllers\/Auth\/RegisterController.php":"64b03c166cb7e856f631bae916199add","app\/Http\/Controllers\/Auth\/VerificationController.php":"1b6f2e916bde69d3275883aae411f78d","app\/Http\/Controllers\/Auth\/ForgotPasswordController.php":"b06419407998c87cf5d89c8936f87810","app\/Http\/Controllers\/Auth\/ChangePasswordController.php":"057201b4f14d70c5d8450966943f7a9b","app\/Http\/Controllers\/Auth\/ConfirmPasswordController.php":"3ce0c3b0a4be919bdb39e7bd7e42a894","app\/Http\/Controllers\/Auth\/LoginController.php":"51e0c4938d8568990326a16f47993774","app\/Http\/Controllers\/Auth\/ResetPasswordController.php":"17de80faf8d3652db1277c64cd7cab1d","app\/Http\/Controllers\/Auth\/ProfileController.php":"462ff2a3b6ada8b9cb72b9000209e321","app\/Http\/Controllers\/SetupController.php":"40bc4b1d3b35aff81cec5c8d78c4754e","app\/Http\/Controllers\/Controller.php":"d2ab2e1e385a80aec6042dc23e7f86eb","app\/Http\/Controllers\/Workspaces\/WorkspaceUsersController.php":"dd2091a562bfc77ce849fff6720ebd86","app\/Http\/Controllers\/Workspaces\/WorkspaceInvitationsController.php":"62695e110bd391adeabdf9370d7e6336","app\/Http\/Controllers\/Workspaces\/SwitchWorkspaceController.php":"1ec0a5dc7c84a8409f4526a47a634497","app\/Http\/Controllers\/Workspaces\/PendingInvitationController.php":"0114fff979705de8bee82e163235482e","app\/Http\/Controllers\/Workspaces\/WorkspacesController.php":"a685eff29367597c4e6f6e706b005add","app\/Http\/Kernel.php":"b981843a2a2a59c3c0d9ea9694370134","app\/Http\/Resources\/Workspace.php":"d067a6f07bd550d4153c310c28715681","app\/Http\/Requests\/ApiTokens\/ApiTokenStoreRequest.php":"56c01901a407bb57f20dd618b4fdf89e","app\/Http\/Requests\/Workspaces\/CreateWorkspaceRequest.php":"c07da30174e0dd1a6815cffb3ca2c831","app\/Http\/Requests\/Workspaces\/WorkspaceUpdateRequest.php":"a1308a6bc8750c36ce811f1e8265b365","app\/Http\/Requests\/Workspaces\/WorkspaceInvitationStoreRequest.php":"71ada4990b3bd30b067d90e0ac67bad0","app\/Http\/Requests\/Workspaces\/WorkspaceStoreRequest.php":"1b397a607f55c196444bb5873f0c4224","app\/Http\/Requests\/ChangePasswordRequest.php":"425a965157b3e251d5fa51fb925f2697","app\/Http\/Requests\/ProfileUpdateRequest.php":"a910df5bf61b4ca7bbccb3f3bca9c082","app\/Exceptions\/Handler.php":"665c24eba27dfb276eac81356caedb56","app\/Console\/Commands\/InstallApplication.php":"c31897e6a3c43e30a5836f31b724f5cc","app\/Console\/Commands\/UpgradeApplication.php":"979a37cd757e85d83bb11eba093d0c1a","app\/Console\/Kernel.php":"df2152f06cd07c8e95e36e6afab01c76","app\/Traits\/ChecksInvitations.php":"66c0b922807da00a39471ab9281ce800","app\/Traits\/HasWorkspaces.php":"3b1f1c3bfb64c0485cdbe9c7e22bde30","app\/Traits\/HasSendportalCommandUtilities.php":"4d212d734d0fec6ad91ec58ce300cdc1","app\/Traits\/HasSendportalMigrationHandlers.php":"5c6a183868a086ed718dd85b7f9e1669","app\/Rules\/ValidInvitation.php":"e289a4ac9b5452ce039f9717fbbd57d4","app\/Repositories\/ApiTokenRepository.php":"2e749016d2e80736d99282762bc27e30","app\/Repositories\/WorkspacesRepository.php":"045fd3222c05c6ee10db83e5890c277d","app\/Services\/Workspaces\/AcceptInvitation.php":"b22d7bf8cb78c6b962728d43efcae37e","app\/Services\/Workspaces\/RemoveUserFromWorkspace.php":"e0b7cf22bd2106992f231e3541538a41","app\/Services\/Workspaces\/SendInvitation.php":"41e73e828863468e8433dd8631e2edbb","app\/Services\/Workspaces\/CreateWorkspace.php":"056f398e6a43ed813289dc41c01c5cdd","app\/Services\/Workspaces\/AddWorkspaceMember.php":"910c9a8d07a0579f7012f4c2183f9a9f","server.php":"323b10ec66fb238f6e9897ab36c825b3","config\/sendportal-host.php":"39ddd885f8fd2f326ad15646cf9a69f5","config\/filesystems.php":"137ee6ce65c76f00f676a9d2a3786a36","config\/queue.php":"db0dbed09037496aeb217ae090bbae29","config\/auth.php":"c6d98a3371702805b1143939f0180717","config\/mail.php":"1ef213740cec34cd746079abc9ba275a","config\/view.php":"24e00ccca17634d028fbbfdafd9e7461","config\/horizon.php":"09cf662fcfc7ea53b81b1e0d41deed68","config\/app.php":"a4fe6d4478eb85079fd59964ec1a8869","config\/cache.php":"c266e9b2172f63354184e1be8bf9763e","config\/broadcasting.php":"bf5b67dc7929b3c338925e1ff5b2c43c","config\/hashing.php":"993f7bd4607853d3905cbdb68e27331d","config\/services.php":"601a15384d0786875b6e009f1aff45e4","config\/database.php":"dc3e83d71b2e91970f1c99d2b4b337b5","config\/session.php":"a0eb60b59d22b34e253bd25ea0869932","config\/logging.php":"2d16257864aa0d12378e82882cfd17c3","config\/sendportal.php":"41cd7d8566ea01a15b9f4a25f5083b3f","config\/cors.php":"c50ff880307bd72e3271f2ec32b78f5e","tests\/TestSupportTrait.php":"c0c6eb36887e08a46d48abc2632e7f50","tests\/Unit\/ExampleTest.php":"27eacc0fde35be1db9c989b11cbbf18f","tests\/TestCase.php":"8dbce99cc4820fc4b8ece1da1b8c26af","tests\/CreatesApplication.php":"cb2f21cebfcc89f2c0d910dcc8c98815","tests\/Feature\/Auth\/AuthConfigEnabledTest.php":"d796b680b592b0ee04cfd56e937c8756","tests\/Feature\/Auth\/WorkspaceApiTokenTest.php":"e216eefbd964ce3b36aa08d27987d90c","tests\/Feature\/Auth\/AuthConfigDisabledTest.php":"812a8b8bc4d4aa7d03a43c868342d8f3","tests\/Feature\/Invitations\/NewUserInvitationTest.php":"9e4d109041157b17d4874d6fa38aa4dd","tests\/Feature\/Invitations\/ExistingUserInvitationTest.php":"dd43ce86c0349f4163e18a7b047a89db","tests\/Feature\/Setup\/SetupControllerTest.php":"5efe56576a1ff70bdd6c731c15ab649b","tests\/Feature\/Setup\/SetupTest.php":"4038362c0007e17d90b4ab55406213a2","tests\/Feature\/Workspaces\/WorkspaceRequiredTest.php":"897d8d05c84dd75e88d69ceb0df4f4f4","tests\/Feature\/Workspaces\/WorkspacesControllerTest.php":"a687a0f5ee70e97ad5e1c7f554c71296","tests\/Feature\/Workspaces\/SwitchWorkspaceTest.php":"c2916a1f420563106e637f028efcd3f7","tests\/Feature\/Workspaces\/WorkspaceInvitationsControllerTest.php":"5b48ebdf6d2206b925579e4d84a682a1","tests\/Feature\/Workspaces\/WorkspaceUserControllerTest.php":"597c1f354a2582ad09296999b379f7d0"}} \ No newline at end of file +{"php":"8.1.12","version":"3.13.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"no_empty_statement":true,"no_useless_return":true,"not_operator_with_successor_space":true,"explicit_string_variable":true,"simple_to_complex_string_variable":true,"array_indentation":true,"blank_line_before_statement":{"statements":["case","default","declare","do","goto","if","include","include_once","require","require_once","switch","try"]}},"hashes":{"routes\/console.php":"043de8d2168ad1c2f19f1f32431ca640","routes\/api.php":"1cfef62d42fc585043690f50f0d7816f","routes\/web.php":"765479749fce08c21ce3c82878dc68e5","routes\/channels.php":"edadd8dfa4a96a42dde09f4ba1362bbd","database\/seeders\/DatabaseSeeder.php":"863fc820d5b1b26b07ff78678e75c600","database\/factories\/UserFactory.php":"14bb2790d699e4c12d3c921413397816","database\/factories\/InvitationFactory.php":"5d7806ef7213f9b8d0ccb1a67572c1c2","database\/factories\/ApiTokenFactory.php":"39a07fd93703811c1e8138c90f617cc5","database\/factories\/WorkspaceFactory.php":"8eb260ed12b4aeef9662731f5f927524","database\/migrations\/2014_10_12_000000_create_users_table.php":"6f6305c9621dc43a7e4e67692f74823a","database\/migrations\/2019_08_19_000000_create_failed_jobs_table.php":"2d2101455252f967fc9f40bdfd44c96f","database\/migrations\/2017_04_11_100000_create_invitations_table.php":"4498012dc9968cfbe113a08f39ee14da","database\/migrations\/2021_01_26_151747_remove_api_token_from_users_table.php":"768971eed7996a173e67e9367cab22ef","database\/migrations\/2019_08_24_114758_adjust_users_table.php":"8a5aee2cd552991b28f0d9633d54efe9","database\/migrations\/2017_04_11_000000_create_workspaces_table.php":"523915ba995bcc529a38261248825b82","database\/migrations\/2020_11_13_120125_create_api_tokens_table.php":"7ee00241a111ac86e6ce713f220dfa0c","database\/migrations\/2014_10_12_100000_create_password_resets_table.php":"6a565de52ad5c704c0a50d9da2dce231","app\/Providers\/EventServiceProvider.php":"34a080e907226081e6958d8e1611101e","app\/Providers\/AppServiceProvider.php":"238832fb41ec4d01ea13a4e3d8688b1f","app\/Providers\/BroadcastServiceProvider.php":"0ee72a104b9018e848f386a2d425bd36","app\/Providers\/HorizonServiceProvider.php":"7b22e94cc33bfe5edadd55ddbb24bbf8","app\/Providers\/AuthServiceProvider.php":"e6e625536689ce1bf6cfa9a02e66457f","app\/Providers\/RouteServiceProvider.php":"89a38040e0eb44cbd3c9fd286eb55f39","app\/Setup\/WritesToEnvironment.php":"b44dd1d8d356f69bb27369f59de68296","app\/Setup\/Migrations.php":"442db278c9932e2729addf6e619e01d6","app\/Setup\/Admin.php":"e4685eb3e4243ccf9131cd1a11bfe1a3","app\/Setup\/Env.php":"b93a8f6fe59cc983f49f3c8cc33bc064","app\/Setup\/Database.php":"39161becadde353e1bd8b8f4e2afebdb","app\/Setup\/Key.php":"611620a7586d5319931c3aab0801e66a","app\/Setup\/Url.php":"462d49f15cb5b38e81cd41b479f520c2","app\/Setup\/StepInterface.php":"95ef7030278de820339ab94bbbbbf231","app\/Models\/User.php":"4a2f6361032921bc17bbea9d540b3527","app\/Models\/ApiToken.php":"24bb163dec324c56b5a763f6e473671b","app\/Models\/Invitation.php":"5f1116032f469de07b258c28a04d2630","app\/Models\/Workspace.php":"d1ea509954f2474880e6074aada00b91","app\/Livewire\/Setup.php":"1e1c86301c8c7f0b2a128e90d5c203a6","app\/Http\/Middleware\/Authenticate.php":"1a28ab8a480d33b5e262412c084e77b2","app\/Http\/Middleware\/TrustProxies.php":"80202bd7bf4c31e901f1043346b82dad","app\/Http\/Middleware\/LocaleMiddleware.php":"1386bc4ac32df382c5631101b0f9339e","app\/Http\/Middleware\/VerifyCsrfToken.php":"707f8a5975d94d67dc2e9f5b6c561cef","app\/Http\/Middleware\/RequireWorkspace.php":"410b7682a4f21bfb81143d6469eaaa77","app\/Http\/Middleware\/EncryptCookies.php":"f6f49f8cb83225155ebe207c0eb24c18","app\/Http\/Middleware\/RedirectIfAuthenticated.php":"ddbd033d07f29b97941e2e021a78eab4","app\/Http\/Middleware\/OwnsRequestedWorkspace.php":"99b3eb77cb33c12f4630f0ff0bf0a84e","app\/Http\/Middleware\/OwnsCurrentWorkspace.php":"ddd644de44de55bed0d14a058534da5f","app\/Http\/Middleware\/CheckForMaintenanceMode.php":"13fecdea17d95ffe8f70fe3c56e0f497","app\/Http\/Middleware\/TrustHosts.php":"181bdfdfebffb2e8019806a7b3c061bd","app\/Http\/Middleware\/TrimStrings.php":"6147464a2cd11a9b32189c718f3e1fa5","app\/Http\/Controllers\/Auth\/ApiTokenController.php":"422df9c575b44baa0dd4554037164745","app\/Http\/Controllers\/Auth\/RegisterController.php":"64b03c166cb7e856f631bae916199add","app\/Http\/Controllers\/Auth\/VerificationController.php":"1b6f2e916bde69d3275883aae411f78d","app\/Http\/Controllers\/Auth\/ForgotPasswordController.php":"b06419407998c87cf5d89c8936f87810","app\/Http\/Controllers\/Auth\/ChangePasswordController.php":"057201b4f14d70c5d8450966943f7a9b","app\/Http\/Controllers\/Auth\/ConfirmPasswordController.php":"3ce0c3b0a4be919bdb39e7bd7e42a894","app\/Http\/Controllers\/Auth\/LoginController.php":"51e0c4938d8568990326a16f47993774","app\/Http\/Controllers\/Auth\/ResetPasswordController.php":"17de80faf8d3652db1277c64cd7cab1d","app\/Http\/Controllers\/Auth\/ProfileController.php":"462ff2a3b6ada8b9cb72b9000209e321","app\/Http\/Controllers\/SetupController.php":"40bc4b1d3b35aff81cec5c8d78c4754e","app\/Http\/Controllers\/Controller.php":"d2ab2e1e385a80aec6042dc23e7f86eb","app\/Http\/Controllers\/Workspaces\/WorkspaceUsersController.php":"dd2091a562bfc77ce849fff6720ebd86","app\/Http\/Controllers\/Workspaces\/WorkspaceInvitationsController.php":"62695e110bd391adeabdf9370d7e6336","app\/Http\/Controllers\/Workspaces\/SwitchWorkspaceController.php":"1ec0a5dc7c84a8409f4526a47a634497","app\/Http\/Controllers\/Workspaces\/PendingInvitationController.php":"0114fff979705de8bee82e163235482e","app\/Http\/Controllers\/Workspaces\/WorkspacesController.php":"a685eff29367597c4e6f6e706b005add","app\/Http\/Kernel.php":"1dfadea0c178c607de61469a99f0f89f","app\/Http\/Resources\/Workspace.php":"d067a6f07bd550d4153c310c28715681","app\/Http\/Requests\/ApiTokens\/ApiTokenStoreRequest.php":"56c01901a407bb57f20dd618b4fdf89e","app\/Http\/Requests\/Workspaces\/CreateWorkspaceRequest.php":"c07da30174e0dd1a6815cffb3ca2c831","app\/Http\/Requests\/Workspaces\/WorkspaceUpdateRequest.php":"a1308a6bc8750c36ce811f1e8265b365","app\/Http\/Requests\/Workspaces\/WorkspaceInvitationStoreRequest.php":"71ada4990b3bd30b067d90e0ac67bad0","app\/Http\/Requests\/Workspaces\/WorkspaceStoreRequest.php":"1b397a607f55c196444bb5873f0c4224","app\/Http\/Requests\/ChangePasswordRequest.php":"425a965157b3e251d5fa51fb925f2697","app\/Http\/Requests\/ProfileUpdateRequest.php":"a910df5bf61b4ca7bbccb3f3bca9c082","app\/Exceptions\/Handler.php":"665c24eba27dfb276eac81356caedb56","app\/Console\/Commands\/InstallApplication.php":"c31897e6a3c43e30a5836f31b724f5cc","app\/Console\/Commands\/UpgradeApplication.php":"979a37cd757e85d83bb11eba093d0c1a","app\/Console\/Kernel.php":"df2152f06cd07c8e95e36e6afab01c76","app\/Traits\/ChecksInvitations.php":"66c0b922807da00a39471ab9281ce800","app\/Traits\/HasWorkspaces.php":"3b1f1c3bfb64c0485cdbe9c7e22bde30","app\/Traits\/HasSendportalCommandUtilities.php":"4d212d734d0fec6ad91ec58ce300cdc1","app\/Traits\/HasSendportalMigrationHandlers.php":"5c6a183868a086ed718dd85b7f9e1669","app\/Rules\/ValidInvitation.php":"e289a4ac9b5452ce039f9717fbbd57d4","app\/Repositories\/ApiTokenRepository.php":"2e749016d2e80736d99282762bc27e30","app\/Repositories\/WorkspacesRepository.php":"045fd3222c05c6ee10db83e5890c277d","app\/Services\/Workspaces\/AcceptInvitation.php":"b22d7bf8cb78c6b962728d43efcae37e","app\/Services\/Workspaces\/RemoveUserFromWorkspace.php":"e0b7cf22bd2106992f231e3541538a41","app\/Services\/Workspaces\/SendInvitation.php":"41e73e828863468e8433dd8631e2edbb","app\/Services\/Workspaces\/CreateWorkspace.php":"056f398e6a43ed813289dc41c01c5cdd","app\/Services\/Workspaces\/AddWorkspaceMember.php":"910c9a8d07a0579f7012f4c2183f9a9f","server.php":"323b10ec66fb238f6e9897ab36c825b3","config\/sendportal-host.php":"39ddd885f8fd2f326ad15646cf9a69f5","config\/filesystems.php":"137ee6ce65c76f00f676a9d2a3786a36","config\/queue.php":"db0dbed09037496aeb217ae090bbae29","config\/auth.php":"c6d98a3371702805b1143939f0180717","config\/mail.php":"1ef213740cec34cd746079abc9ba275a","config\/view.php":"24e00ccca17634d028fbbfdafd9e7461","config\/horizon.php":"09cf662fcfc7ea53b81b1e0d41deed68","config\/app.php":"a4fe6d4478eb85079fd59964ec1a8869","config\/cache.php":"c266e9b2172f63354184e1be8bf9763e","config\/broadcasting.php":"bf5b67dc7929b3c338925e1ff5b2c43c","config\/hashing.php":"993f7bd4607853d3905cbdb68e27331d","config\/services.php":"601a15384d0786875b6e009f1aff45e4","config\/database.php":"8b1b900d640813d259a43082fa433c10","config\/session.php":"a0eb60b59d22b34e253bd25ea0869932","config\/logging.php":"2d16257864aa0d12378e82882cfd17c3","config\/sendportal.php":"41cd7d8566ea01a15b9f4a25f5083b3f","config\/cors.php":"c50ff880307bd72e3271f2ec32b78f5e","tests\/TestSupportTrait.php":"c0c6eb36887e08a46d48abc2632e7f50","tests\/Unit\/ExampleTest.php":"27eacc0fde35be1db9c989b11cbbf18f","tests\/TestCase.php":"8dbce99cc4820fc4b8ece1da1b8c26af","tests\/CreatesApplication.php":"cb2f21cebfcc89f2c0d910dcc8c98815","tests\/Feature\/Auth\/AuthConfigEnabledTest.php":"20f56f205e27b839203871a5d42e3dc2","tests\/Feature\/Auth\/WorkspaceApiTokenTest.php":"f88035c2ef21a5ab506432afb5d14a97","tests\/Feature\/Auth\/AuthConfigDisabledTest.php":"70b9f8eca37e988e3b42c56cb0c729a4","tests\/Feature\/Invitations\/NewUserInvitationTest.php":"2649b09b33846006b29a4e13e1532709","tests\/Feature\/Invitations\/ExistingUserInvitationTest.php":"b61fc16b31b9586a0d65a706e32cbd4d","tests\/Feature\/Setup\/SetupControllerTest.php":"6950e9d0dd7037abfc34cba83c7c359a","tests\/Feature\/Setup\/SetupTest.php":"a2a32f9274435305ec4afd1047813184","tests\/Feature\/Workspaces\/WorkspaceRequiredTest.php":"f243fdd3c8ec97dd5f2ac2600584cbde","tests\/Feature\/Workspaces\/WorkspacesControllerTest.php":"a97f8b2ee3d3351ce540197a2b7c5661","tests\/Feature\/Workspaces\/SwitchWorkspaceTest.php":"25b9cf82c1a43acd842852180e5e5441","tests\/Feature\/Workspaces\/WorkspaceInvitationsControllerTest.php":"e7d37474ad42c9400b814761910d0773","tests\/Feature\/Workspaces\/WorkspaceUserControllerTest.php":"43e77695602d717c46b0cd1431764127","app\/Http\/Middleware\/PreventRequestForgery.php":"e84d63de05267804d02c78acfd2dd5db"}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c1288b67f..762b81933 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Sendportal +## 4.0.0 - Unreleased +- Update to Laravel 13 and sendportal-core 4 +- Require PHP 8.3+ +- Rename `VerifyCsrfToken` middleware to `PreventRequestForgery` +- Upgrade to PHPUnit 12 and convert test annotations to attributes + ## 3.0.0 - 2024-04-19 - Update to Laravel 11 ([#290](https://github.com/mettle/sendportal/pull/290) diff --git a/README.md b/README.md index c214a0c74..e5035178a 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,19 @@ The [SendPortal](https://github.com/mettle/sendportal) application acts as a wra ## Installation -If you would like to install SendPortal as a stand-alone application, please follow the [installation guide](https://sendportal.io/docs/v2/getting-started/installation). +If you would like to install SendPortal as a stand-alone application, please follow the [installation guide](https://sendportal.io/docs/v4/getting-started/installation). -If you would like to add SendPortal to an existing application, please follow the [package installation guide](https://sendportal.io/docs/v2/getting-started/package-installation). +If you would like to add SendPortal to an existing application, please follow the [package installation guide](https://sendportal.io/docs/v4/getting-started/package-installation). + +If you are upgrading from SendPortal V3, please follow the [upgrade guide](https://sendportal.io/docs/v4/getting-started/upgrade-guide). ## Requirements -SendPortal V3 requires: +SendPortal V4 requires: + +- PHP 8.3+ +- Laravel 13 +- MySQL (≥ 5.7) or PostgreSQL (≥ 10) -- PHP 8.2+ -- Laravel 10+ -- MySQL (≥ 5.7) or PostgreSQL (≥ 9.4) +If you are on PHP 8.2 or Laravel 10/11, please use [SendPortal V3](https://github.com/mettle/sendportal/releases/tag/v3.0.0) If you are on an earlier version of PHP (7.3+) or Laravel (8+), please use [SendPortal V2](https://github.com/mettle/sendportal/releases/tag/v2.0.4) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index d9e764285..659c6f2dc 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -35,7 +35,7 @@ class Kernel extends HttpKernel \Illuminate\Session\Middleware\StartSession::class, // \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, + \App\Http\Middleware\PreventRequestForgery::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, ], diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/PreventRequestForgery.php similarity index 60% rename from app/Http/Middleware/VerifyCsrfToken.php rename to app/Http/Middleware/PreventRequestForgery.php index 0c13b8548..9b1194118 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/PreventRequestForgery.php @@ -2,9 +2,9 @@ namespace App\Http\Middleware; -use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; +use Illuminate\Foundation\Http\Middleware\PreventRequestForgery as Middleware; -class VerifyCsrfToken extends Middleware +class PreventRequestForgery extends Middleware { /** * The URIs that should be excluded from CSRF verification. diff --git a/composer.json b/composer.json index 24195a1d9..9de3798c1 100644 --- a/composer.json +++ b/composer.json @@ -4,22 +4,22 @@ "description": "SendPortal. Open-source self-hosted email marketing. Manage your own newsletters at a fraction of the cost.", "license": "MIT", "require": { - "php": "^8.2|^8.3", - "guzzlehttp/guzzle": "^7.8.1", - "laravel/framework": "^11.0", - "laravel/horizon": "^5.24", - "laravel/tinker": "^2.9", - "livewire/livewire": "^3.4", - "laravel/ui": "^4.5", - "mettle/sendportal-core": "^3.0" + "php": "^8.3", + "guzzlehttp/guzzle": "^7.10", + "laravel/framework": "^13.0", + "laravel/horizon": "^5.50", + "laravel/tinker": "^3.0", + "livewire/livewire": "^3.8", + "laravel/ui": "^4.6", + "mettle/sendportal-core": "^4.0" }, "require-dev": { - "fakerphp/faker": "^1.23", - "mockery/mockery": "^1.6", - "nunomaduro/collision": "^8.1", - "phpunit/phpunit": "^10.5", + "fakerphp/faker": "^1.24", + "mockery/mockery": "^1.6.12", + "nunomaduro/collision": "^8.9", + "phpunit/phpunit": "^12.5", "roave/security-advisories": "dev-master", - "spatie/laravel-ignition": "^2.5.1" + "spatie/laravel-ignition": "^2.12" }, "config": { "optimize-autoloader": true, diff --git a/config/database.php b/config/database.php index dc722b5fd..1a8046e81 100644 --- a/config/database.php +++ b/config/database.php @@ -59,7 +59,7 @@ 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + (PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b302e4890..3ce0fb545 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + tests diff --git a/tests/Feature/Auth/AuthConfigDisabledTest.php b/tests/Feature/Auth/AuthConfigDisabledTest.php index 3433b5ae1..b1e44ffea 100644 --- a/tests/Feature/Auth/AuthConfigDisabledTest.php +++ b/tests/Feature/Auth/AuthConfigDisabledTest.php @@ -6,6 +6,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class AuthConfigDisabledTest extends TestCase @@ -21,7 +22,7 @@ public function setUp(): void parent::setUp(); } - /** @test */ + #[Test] public function the_registration_routes_result_in_404() { $this->get('/register')->assertNotFound(); @@ -32,7 +33,7 @@ public function the_registration_routes_result_in_404() $this->post('email/resend')->assertNotFound(); } - /** @test */ + #[Test] public function the_password_reset_routes_result_in_404() { $this->get('password/reset')->assertNotFound(); diff --git a/tests/Feature/Auth/AuthConfigEnabledTest.php b/tests/Feature/Auth/AuthConfigEnabledTest.php index 16d3ab44e..f0cc9b5a2 100644 --- a/tests/Feature/Auth/AuthConfigEnabledTest.php +++ b/tests/Feature/Auth/AuthConfigEnabledTest.php @@ -6,6 +6,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class AuthConfigEnabledTest extends TestCase @@ -21,13 +22,13 @@ public function setUp(): void parent::setUp(); } - /** @test */ + #[Test] public function the_registration_routes_result_in_200() { $this->get('/register')->assertOk(); } - /** @test */ + #[Test] public function the_password_reset_routes_result_in_200() { $this->get('password/reset')->assertOk(); diff --git a/tests/Feature/Auth/WorkspaceApiTokenTest.php b/tests/Feature/Auth/WorkspaceApiTokenTest.php index db85853d5..dddaa1a6f 100644 --- a/tests/Feature/Auth/WorkspaceApiTokenTest.php +++ b/tests/Feature/Auth/WorkspaceApiTokenTest.php @@ -8,6 +8,8 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Str; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class WorkspaceApiTokenTest extends TestCase @@ -15,11 +17,8 @@ class WorkspaceApiTokenTest extends TestCase use RefreshDatabase; use WithFaker; - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function valid_api_token_grants_access() { [$workspace, $user] = $this->createUserAndWorkspace(); @@ -37,7 +36,7 @@ public function valid_api_token_grants_access() $response->assertStatus(200); } - /** @test */ + #[Test] public function a_401_is_thrown_when_invalid_token_provided() { [$workspace, $user] = $this->createUserAndWorkspace(); @@ -55,7 +54,7 @@ public function a_401_is_thrown_when_invalid_token_provided() $response->assertUnauthorized(); } - /** @test */ + #[Test] public function a_401_is_thrown_when_no_token_is_provided() { $response = $this->get(route('sendportal.api.subscribers.index')); diff --git a/tests/Feature/Invitations/ExistingUserInvitationTest.php b/tests/Feature/Invitations/ExistingUserInvitationTest.php index 33e5c7849..e971e3aa4 100644 --- a/tests/Feature/Invitations/ExistingUserInvitationTest.php +++ b/tests/Feature/Invitations/ExistingUserInvitationTest.php @@ -8,6 +8,7 @@ use App\Models\Workspace; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Str; +use PHPUnit\Framework\Attributes\Test; use Ramsey\Uuid\Uuid; use Tests\TestCase; @@ -15,7 +16,7 @@ class ExistingUserInvitationTest extends TestCase { use RefreshDatabase; - /** @test */ + #[Test] public function a_user_can_see_their_invitations() { // given @@ -42,7 +43,7 @@ public function a_user_can_see_their_invitations() $response->assertSee('Reject'); } - /** @test */ + #[Test] public function a_user_cannot_see_another_users_invitations() { // given @@ -70,7 +71,7 @@ public function a_user_cannot_see_another_users_invitations() $response->assertDontSee($newWorkspace->name); } - /** @test */ + #[Test] public function a_user_can_accept_valid_invitations() { // given @@ -97,7 +98,7 @@ public function a_user_can_accept_valid_invitations() self::assertTrue($user->fresh()->onWorkspace($newWorkspace)); } - /** @test */ + #[Test] public function a_user_can_reject_invitations() { // given @@ -128,7 +129,7 @@ public function a_user_can_reject_invitations() ]); } - /** @test */ + #[Test] public function a_user_cannot_accept_an_expired_invitation() { // given diff --git a/tests/Feature/Invitations/NewUserInvitationTest.php b/tests/Feature/Invitations/NewUserInvitationTest.php index 4032c454c..87855c9f4 100644 --- a/tests/Feature/Invitations/NewUserInvitationTest.php +++ b/tests/Feature/Invitations/NewUserInvitationTest.php @@ -10,6 +10,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Event; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class NewUserInvitationTest extends TestCase @@ -24,7 +25,7 @@ public function setUp(): void parent::setUp(); } - /** @test */ + #[Test] public function a_new_user_can_register_with_an_invitation_to_an_existing_workspace() { Event::fake(); @@ -67,7 +68,7 @@ public function a_new_user_can_register_with_an_invitation_to_an_existing_worksp ); } - /** @test */ + #[Test] public function a_user_cannot_see_the_register_form_with_an_invalid_invitation() { // when @@ -78,7 +79,7 @@ public function a_user_cannot_see_the_register_form_with_an_invalid_invitation() $response->assertSessionHas('error', 'The invitation is no longer valid.'); } - /** @test */ + #[Test] public function registrations_fail_validation_when_invitation_is_invalid() { // given diff --git a/tests/Feature/Setup/SetupControllerTest.php b/tests/Feature/Setup/SetupControllerTest.php index 760740f6b..5f167381c 100644 --- a/tests/Feature/Setup/SetupControllerTest.php +++ b/tests/Feature/Setup/SetupControllerTest.php @@ -6,13 +6,14 @@ use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class SetupControllerTest extends TestCase { use RefreshDatabase; - /** @test */ + #[Test] public function it_should_show_the_setup_view_if_sendportal_is_not_installed() { $this @@ -21,7 +22,7 @@ public function it_should_show_the_setup_view_if_sendportal_is_not_installed() ->assertSeeLivewire('setup'); } - /** @test */ + #[Test] public function it_should_redirect_the_user_to_the_login_page_if_sendportal_is_already_installed() { User::factory()->create(); diff --git a/tests/Feature/Setup/SetupTest.php b/tests/Feature/Setup/SetupTest.php index 9b2bd4ff3..3ea72e668 100644 --- a/tests/Feature/Setup/SetupTest.php +++ b/tests/Feature/Setup/SetupTest.php @@ -7,22 +7,24 @@ use App\Livewire\Setup; use App\Setup\Admin; use App\Setup\Env; +use App\Setup\Url; use Illuminate\Foundation\Testing\RefreshDatabase; use Livewire\Livewire; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class SetupTest extends TestCase { use RefreshDatabase; - /** @test */ + #[Test] public function the_setup_component_should_render_the_correct_view() { Livewire::test(Setup::class) ->assertViewIs('livewire.setup'); } - /** @test */ + #[Test] public function the_setup_component_should_have_6_steps() { $setup = Livewire::test(Setup::class); @@ -30,7 +32,7 @@ public function the_setup_component_should_have_6_steps() self::assertCount(6, $setup->get('steps')); } - /** @test */ + #[Test] public function the_setup_component_should_check_the_first_step_when_mounted_and_stop_if_its_false() { $this->mock( @@ -46,9 +48,17 @@ function ($mock) { $setup->assertSet('progress', 0); } - /** @test */ + #[Test] public function the_setup_command_should_stop_on_the_admin_step_if_there_are_not_users() { + // These steps depend on the local .env file and APP_URL rather than the code under test. + $this->mock(Env::class, function ($mock) { + $mock->shouldReceive('check')->andReturn(true); + }); + $this->mock(Url::class, function ($mock) { + $mock->shouldReceive('check')->andReturn(true); + }); + $setup = Livewire::test(Setup::class); $setup->assertSet('active', 5); @@ -57,6 +67,6 @@ public function the_setup_command_should_stop_on_the_admin_step_if_there_are_not $step = $setup->get('steps')[$setup->get('active')]; self::assertEquals(Admin::class, $step['handler']); - self::assertEquals(5, $step['completed']); + self::assertFalse($step['completed']); } } diff --git a/tests/Feature/Workspaces/SwitchWorkspaceTest.php b/tests/Feature/Workspaces/SwitchWorkspaceTest.php index d99d83697..be6234ab0 100644 --- a/tests/Feature/Workspaces/SwitchWorkspaceTest.php +++ b/tests/Feature/Workspaces/SwitchWorkspaceTest.php @@ -7,13 +7,14 @@ use App\Models\Workspace; use App\Services\Workspaces\AddWorkspaceMember; use Illuminate\Foundation\Testing\RefreshDatabase; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class SwitchWorkspaceTest extends TestCase { use RefreshDatabase; - /** @test */ + #[Test] public function a_user_can_switch_between_workspaces() { // given @@ -33,7 +34,7 @@ public function a_user_can_switch_between_workspaces() self::assertEquals($secondWorkspace->id, $user->currentWorkspace()->id); } - /** @test */ + #[Test] public function a_user_cannot_switch_to_a_workspace_they_do_not_belong_to() { // given @@ -51,7 +52,7 @@ public function a_user_cannot_switch_to_a_workspace_they_do_not_belong_to() self::assertEquals($workspace->id, $user->currentWorkspace()->id); } - /** @test */ + #[Test] public function a_guest_cannot_switch_workspaces() { // given diff --git a/tests/Feature/Workspaces/WorkspaceInvitationsControllerTest.php b/tests/Feature/Workspaces/WorkspaceInvitationsControllerTest.php index b1ec8d9be..59e0a0582 100644 --- a/tests/Feature/Workspaces/WorkspaceInvitationsControllerTest.php +++ b/tests/Feature/Workspaces/WorkspaceInvitationsControllerTest.php @@ -11,6 +11,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Mail; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class WorkspaceInvitationsControllerTest extends TestCase @@ -18,7 +19,7 @@ class WorkspaceInvitationsControllerTest extends TestCase use RefreshDatabase; use WithFaker; - /** @test */ + #[Test] public function an_invitation_can_be_sent_to_a_new_user() { // given @@ -47,7 +48,7 @@ public function an_invitation_can_be_sent_to_a_new_user() ); } - /** @test */ + #[Test] public function an_invitation_can_be_sent_to_an_existing_user() { // given @@ -70,7 +71,7 @@ public function an_invitation_can_be_sent_to_an_existing_user() $this->assertDatabaseEmpty('invitations'); } - /** @test */ + #[Test] public function non_owners_cannot_invite_new_members() { // given @@ -101,7 +102,7 @@ public function non_owners_cannot_invite_new_members() ); } - /** @test */ + #[Test] public function invitations_can_be_retracted() { // given diff --git a/tests/Feature/Workspaces/WorkspaceRequiredTest.php b/tests/Feature/Workspaces/WorkspaceRequiredTest.php index 75e8529e8..c52314f3d 100644 --- a/tests/Feature/Workspaces/WorkspaceRequiredTest.php +++ b/tests/Feature/Workspaces/WorkspaceRequiredTest.php @@ -7,6 +7,8 @@ use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class WorkspaceRequiredTest extends TestCase @@ -14,11 +16,8 @@ class WorkspaceRequiredTest extends TestCase use RefreshDatabase; use WithFaker; - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function user_gets_404_if_no_workspace_provided() { // a user is required to avoid 302 redirect by the auth middleware diff --git a/tests/Feature/Workspaces/WorkspaceUserControllerTest.php b/tests/Feature/Workspaces/WorkspaceUserControllerTest.php index c9817752d..69a3b5859 100644 --- a/tests/Feature/Workspaces/WorkspaceUserControllerTest.php +++ b/tests/Feature/Workspaces/WorkspaceUserControllerTest.php @@ -7,17 +7,16 @@ use App\Models\User; use App\Models\Workspace; use Illuminate\Foundation\Testing\RefreshDatabase; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class WorkspaceUserControllerTest extends TestCase { use RefreshDatabase; - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function an_unauthenticated_user_cannot_view_the_workspace_user_index() { $response = $this->get(route('users.index')); @@ -25,11 +24,8 @@ public function an_unauthenticated_user_cannot_view_the_workspace_user_index() $this->assertLoginRedirect($response); } - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function users_cannot_view_workspace_users_for_a_workspace_they_do_not_own() { $user = User::factory() @@ -46,11 +42,8 @@ public function users_cannot_view_workspace_users_for_a_workspace_they_do_not_ow $response->assertStatus(404); } - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function users_can_view_workspace_users_for_a_workspace_they_do_own() { $user = $this->createUserWithWorkspace(); @@ -62,11 +55,8 @@ public function users_can_view_workspace_users_for_a_workspace_they_do_own() $response->assertSee($user->name); } - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function workspace_owners_can_remove_users_from_their_workspace() { $user = $this->createUserWithWorkspace(); @@ -82,11 +72,8 @@ public function workspace_owners_can_remove_users_from_their_workspace() self::assertFalse($otherUser->fresh()->onWorkspace($workspace)); } - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function workspace_owners_cannot_remove_themselves_from_their_workspace() { [$workspace, $user] = $this->createUserAndWorkspace(); @@ -99,11 +86,8 @@ public function workspace_owners_cannot_remove_themselves_from_their_workspace() self::assertTrue($user->onWorkspace($workspace)); } - /** - * @test - * - * @group workspace_user_test - */ + #[Test] + #[Group('workspace_user_test')] public function only_workspace_owners_can_remove_users_from_a_workspace() { $user = User::factory() diff --git a/tests/Feature/Workspaces/WorkspacesControllerTest.php b/tests/Feature/Workspaces/WorkspacesControllerTest.php index 75434c299..0f59bc7f8 100644 --- a/tests/Feature/Workspaces/WorkspacesControllerTest.php +++ b/tests/Feature/Workspaces/WorkspacesControllerTest.php @@ -9,6 +9,7 @@ use App\Services\Workspaces\AddWorkspaceMember; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class WorkspacesControllerTest extends TestCase @@ -16,7 +17,7 @@ class WorkspacesControllerTest extends TestCase use RefreshDatabase; use WithFaker; - /** @test */ + #[Test] public function a_user_can_see_an_index_of_their_workspaces() { // given @@ -38,7 +39,7 @@ public function a_user_can_see_an_index_of_their_workspaces() $response->assertSee($workspaces[1]->name); } - /** @test */ + #[Test] public function a_user_can_create_a_new_workspace() { // given