php-tenant/tests/Feature
Claude a07bfb3fd2
feat: add workspace ownership transfer
Add transferOwnership() method to the Workspace model that allows the
current owner to transfer ownership to another existing workspace member.

The method:
- Verifies the new owner is an existing member
- Demotes the current owner to admin role
- Promotes the new owner to owner role
- Updates team assignments when teams are in use
- Wraps the role changes in a DB transaction
- Dispatches WorkspaceOwnershipTransferred event
- Throws WorkspaceOwnershipException for auth/validation failures

New files:
- Events/WorkspaceOwnershipTransferred.php
- Exceptions/WorkspaceOwnershipException.php
- tests/Feature/WorkspaceOwnershipTransferTest.php

Fixes #35

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:56:18 +00:00
..
Guards fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
AccountDeletionTest.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00
AuthenticationTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
EntitlementApiTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
EntitlementServiceTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
ProfileTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
ResetBillingCyclesTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
SettingsTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
TwoFactorAuthenticatableTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
UsageAlertServiceTest.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00
WaitlistTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
WorkspaceCacheTest.php refactor: rename namespace from Core\Mod\Tenant to Core\Tenant 2026-01-27 16:30:46 +00:00
WorkspaceInvitationTest.php chore: fix pint code style and add test config 2026-02-23 03:50:04 +00:00
WorkspaceOwnershipTransferTest.php feat: add workspace ownership transfer 2026-03-24 13:56:18 +00:00
WorkspaceSecurityTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00
WorkspaceTenancyTest.php fix(tenant): add strict_types and fix PSR-12 compliance across all PHP files 2026-03-17 09:11:54 +00:00