1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 06:44:04 +00:00
tenancy/tests
Samuel Štancl 6523f24a60 Pending tenants: Add getPendingAttributes()
This method lets the user specify default values for custom
non-nullable columns. The primary use case is when the tenants table
has a column like 'slug' and createPending() is called with no
value for 'slug'. This would produce an exception due to the column
having no default value.

Here, getPendingAttributes() can set an initial dummy slug (like a
randomly generated string) before it's overwritten during a pull.

getPendingAttributes() accepts an $attributes array which corresponds
to the attributes passed to createPending(). The array returned from
getPendingAttributes() is ultimately merged with $attributes, so
the user doesn't need to use the $attributes value in
getPendingAttributes(), however it serves to provide more context when
the pending attributes might be dependent on $attributes and therefore
derived from the $attributes actually being used.

Also fixed the `finally` branch in createPending() as it was
potentially referencing the $tenant variable before it was initialized.
2025-10-28 12:50:13 +01:00
..
Bootstrappers Remove and recategorize todos 2025-08-31 16:57:52 +02:00
Etc Pending tenants: Add getPendingAttributes() 2025-10-28 12:50:13 +01:00
Features Add TenantConfigBootstrapper, deprecate Feature implementation 2025-09-26 13:49:15 +02:00
RLS [4.x] TableRLSManager refactor, comment constraints (#1354) 2025-07-03 21:12:04 +02:00
ActionTest.php resolve minor todos 2025-08-18 15:05:17 +02:00
AutomaticModeTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
BroadcastingTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
CachedTenantResolverTest.php [4.x] Support database cache store tenancy (#1290) (resolve #852) 2025-08-08 00:54:01 +02:00
CloneActionTest.php Add tenant parameter BEFORE existing prefixes by default, add tenantParameterBeforePrefix() to allow customizing this (#1393) 2025-09-03 15:56:12 +02:00
CombinedDomainAndSubdomainIdentificationTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
CommandsTest.php [4.x] Use --database in tenants:migrate as the template connection (#1386) 2025-08-25 15:57:15 +02:00
DatabaseCacheBootstrapperTest.php [4.x] Support database cache store tenancy (#1290) (resolve #852) 2025-08-08 00:54:01 +02:00
DatabasePreparationTest.php Delete unused import (#1382) 2025-07-29 17:18:14 +02:00
DatabaseUsersTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
DeleteDomainsJobTest.php Resolve test to-dos (#45) 2024-04-18 00:22:03 +02:00
DomainTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
EarlyIdentificationTest.php Remove TestCase::randomString() 2025-08-25 17:43:45 +02:00
EventListenerTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
GlobalCacheTest.php [4.x] Support database cache store tenancy (#1290) (resolve #852) 2025-08-08 00:54:01 +02:00
InitializedBootstrappersTest.php [4.x] Only revert initialized bootstrappers (#1385) 2025-08-05 11:12:25 +02:00
MailTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
MaintenanceModeTest.php Fix #1404: support universal routes in CheckTenantForMaintenanceMode 2025-10-14 17:22:35 +02:00
ManualModeTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
OriginHeaderIdentificationTest.php fix origin identification: parse hostname when full URL is used 2025-07-14 21:44:12 +02:00
PathIdentificationTest.php [4.x] Test that route model binding works correctly with path identification (#1360) 2025-06-02 19:05:17 +02:00
PendingTenantsTest.php Pending tenants: Add getPendingAttributes() 2025-10-28 12:50:13 +01:00
Pest.php [4.x] Support database cache store tenancy (#1290) (resolve #852) 2025-08-08 00:54:01 +02:00
PreventAccessFromUnwantedDomainsTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
QueueTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
RequestDataIdentificationTest.php [4.x] Resolve testing todos (#1361) 2025-08-03 23:21:03 +02:00
ResourceSyncingTest.php [4.x] Test that global scopes on syncable models can break resource syncing, and that $scopeGetModelQuery can be used as a workaround for that (#1285) 2025-06-26 13:39:11 +02:00
RouteMiddlewareTest.php Instead of assigning $innerMiddleware during group MW unpacking, merge it (#1371) 2025-07-01 17:23:13 +02:00
RunForMultipleTest.php [4.x] Fix 1267: early return in runForMultiple if an empty array is passed (#1286) 2025-02-14 08:19:02 +01:00
ScopeSessionsTest.php [4.x] Make ScopeSessions usable on universal routes (#1342) 2025-04-04 03:15:37 +02:00
SessionSeparationTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
SingleDatabaseTenancyTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
SingleDomainTenantTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
SubdomainTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
TenantAssetTest.php Remove TestCase::randomString() 2025-08-25 17:43:45 +02:00
TenantAwareCommandTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00
TenantDatabaseManagerTest.php PHP 8.5 support 2025-10-20 01:44:24 +02:00
TenantModelTest.php [4.x] Add ULIDGenerator (#1332) 2025-03-18 19:00:35 +01:00
TenantUserImpersonationTest.php Features refactor 2025-08-31 23:18:44 +02:00
TestCase.php PHP 8.5 support 2025-10-20 01:44:24 +02:00
UniversalRouteTest.php [4.x] Laravel 12 support (#1321) 2025-02-25 16:26:18 +01:00